• 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

How to downgrade or install a specific version of Composer?

Input and output values for php into the browser?

The "client_reference_id" argument is not passed

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

Lumen - Postgresql setup - Composer

WHERE IN array binding in DB::raw laravel 5.4

Laravel Jetsream Profile page not loading on fresh install

How to get variable from JavaScript to PHP [duplicate]

How do I call a php file with axios?

500 Internal Server Error on Ajax request. Not sure the origin of the problem

How to insert Google Adsense Code in PHP script?

Refresh specific HTML content that retrieves data from MySQL

PHP Deprecated issue when running artisan command

With doctrine ODM, can I embed many subdocuments in a main document?

Encrypt in php and decrypt in Dart(flutter)

About Contact Privacy policy Terms and conditions