• 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

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

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

How to add a sidebar to Woocommerce Shop Page?

Not able to override collapsible.js in magento 2

Must be of the type array, null given,

PHP contact form configuration [duplicate]

Remove country code from phone number?

Laravel Delete and Update

How can i hide dt if dd got empty value

How to show a popup modal in codeIgniter?

add_action() function in wordpress not working [duplicate]

Android Volley getParams() method not getting called for JsonObjectRequest

how to get the header value, if we don't know the value because the value is random from the server

Cannot connect to own websocket server when on secured domain

Can't find vendor/autoload.php for Ratchet

About Contact Privacy policy Terms and conditions