• 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

Add Metadata, headers (Expires, CacheControl) to a file uploaded to Amazon S3 using the Laravel 5.0 Storage facade

How can i update or reset my password without entering email field in laravel-8?

Google Gmail API - How to login programatically?

PDOException SQLSTATE[HY000] [2002] No such file or directory

Zig-zag scan an N x N array

How to loop sql table data inside a html table

How to show a popup modal in codeIgniter?

Error converting docx to pdf using Unoconv

Get WooCommerce product variation attribute terms in admin products general box

Could not decode a text frame as UTF-8.

calling server using nusoap with complextype

Is there an equivalent of DynamoDB on Azure as a PHP session Handler

How to get unique slug to same post-title for other time too?

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

PHP: How to quickly split a key=value file into associative array

About Contact Privacy policy Terms and conditions