• 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

XAMPP/SQLSRV: Unable to find Sqlsrv in PHPINFO(); - errors coming from connection

Check if user online laravel

possible options to create pdf file using html elements to generate invoice in php and codeigniter

curl returning 301 error after migrating to https

PHPMetrics option --excluded-dirs="myfolder" : myfolder dir is not excluded within docker

Detect emoticons in string

protect my blog content

Error when uploading certain .png files "Interlace handling should be turned on when using png_read_image"

Check if my GET request has Header: Token

phpseclib 2.0 can not use Composer to create autoload

Navigation idle on content download

How to give apache permission to write to home directory?

How can I make good efficent AJAX live forms with just jQuery and

PHP contact form configuration [duplicate]

How to fix Call to undefined method AppModelsTableName::factory?

About Contact Privacy policy Terms and conditions