• 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

Prestashop cUrl Login

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

how to redirect the user back to desired URL after login page in PHP?

CSS file not imported in laravel blade view

Only on Firefox "Loading failed for the <script> with source"

Execute only one time and then wait set period of time before executing again

Laravel Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttpPsr7Request

Can't call javascript alert alertify library from PHP

get data-value with variable value

CodeIgniter force_download is not working

Issue with laravel eloquent model property

Malformed MIME header error in Symfony 5.3

PHP: Telegram Bot: Insert line break to text message

How can I access an array/object?

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

About Contact Privacy policy Terms and conditions