• 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

Send Outlook 2010 email using PHP

Navigation idle on content download

PHP Print to Network Printer

PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: no such host known

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

How to install LDAP in Docker php-fpm alpine

How can I create a Download Page with post php method?

How to validate tin and cst using PHP?

PHP each() function replacement

CSV to PHP class properties

Printing more than one array using print_r or any other function in php

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

How to get array values using foreach in laravel

Adding hreflang tags automatically in WordPress subdirectory multisite

how to use extended ASCII instead of unicode in PHP

About Contact Privacy policy Terms and conditions