• 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

Pages are working fine on localhost but not running on the hosting server

woocommerce_wp_select options array from product attribute terms

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

Laravel You requested 1 items, but there are only 0 items available

Passing PHP JSON to Javascript: echo json_encode vs echo json declaration

"properties should not be accessed directly" issue during WooCommerce 3.0 checkout

How can I get new CSRF token in LARAVEL by using ajax

How do I refresh a DIV content?

Problems getting instance of UploadedFile in Yii2

PHP, how to convert Int value to Week days

Exact alternate to mcrypt_encrypt in PHP 7.2

How to set a domain name with php artisan serve

NGINX: connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)

Symfony run hint kernel.secret parameter not found

wordpress : How to specify the cause "This site can’t be reached"

About Contact Privacy policy Terms and conditions