• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Open a popup box after receiving result from ajax

javascriptphpjqueryajaxpopup


PHP Snippet 1:

success: function (returndata) {
    if (returndata[4] === 1) {
        $('#bsModal3').modal(); // this
    } else {
        // other code
    }
},

PHP Snippet 2:

$.ajax({
        type: 'post',
        url: 'test2.php',
        dataType: 'json',
        data: {
            txt: txtbox,
            hidden: hiddenTxt
        },
        cache: false,
        success: function (returndata) {
            if (returndata[4] === 1) {
               $('#bsModal3').modal();  // Please right this in your Code
            } else {
                // other code
            }
        },
        error: function () {
            console.error('Failed to process ajax !');
        }
    });

Related Snippets

Target class controller does not exist - Laravel 8

How to get the total hour from starting time to end time in php

PHP - Store information with NO database

PHPExcel file download using AJAX call

Laravel 5 controller sending JSON integer as string

WordPress + Nginx on non-standard port behind AWS ELB results in broken links

Upload a file Using PHP and JavaScript

Return new collection without modifying original collection

Why does using salted hash on python and php give me different results?

php mysql + create a friend request system

PHP array slice from position + attempt to return fixed number of items

PHP Get value from JSON [duplicate]

str_replace or preg_replace random number from string

Failing validation doesn't stop code execution in livewire component

Using Associative arrays

About Contact Privacy policy Terms and conditions