• 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

Get image type from base64 encoded src string

Malformed MIME header error in Symfony 5.3

Log a user out of a website when they put their computer to sleep

I want to display a sweetalert after the inserting of data in my database

How to get AJAX to post on second page?

Update Total in checkout of Woocommerce with Ajax Request

How to use PHPCBF to fix one issue at a time?

Laravel csrf token mismatch for ajax POST Request

How do I get friend list from Friends table with counts of friends of my friends

Why does array_map() with null as callback create an "array of arrays"?

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

Natural ORDER in Laravel Eloquent ORM

add " ? " in url via htaccess RewriteRule

How to unlink image from folder?

MySQL upgrade causing unexpected results on simple WHERE clauses

About Contact Privacy policy Terms and conditions