• 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

Explode not working properly with dash

How to add automatically collapse/expand in content wordpress (single.php)?

CSV to PHP class properties

VichUploaderBundle error "Expected argument of type "File", "NULL" given" when submitting the form without selecting any file

Cannot connect to own websocket server when on secured domain

Need to display only array value in JSON output

How do I refresh a DIV content?

How to set a domain name with php artisan serve

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

how to remove white space in select 2

How to get an Array value inside an object in an array Php [duplicate]

Laravel Gates using model and returns "Using $this when not in object context" Line 28 of AzureUser model

Can I use a WooCommerce function without any WooCommerce page?

How can I easily switch between PHP versions on Mac OSX?

How to unlink image from folder?

About Contact Privacy policy Terms and conditions