• 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

Error Class "LaravelFortifyFeatures" not found

Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

What is the difference between client-side and server-side programming?

Match csv filenames to table names and import

args[max_input] woocommerce if statement confused

Form Validation and Submission to database

Project structure for PHP

Symfony redirect if already loggedin from login page

add " ? " in url via htaccess RewriteRule

phpunit - testing is painfully slow

PHP my timezone is no setting up in PHP.ini File in xampp

woocommerce_wp_select options array from product attribute terms

Accessors (Getter) & Mutators (Setter) On a Pivot Table in Laravel

Show rotation of tweets using current day of month

About Contact Privacy policy Terms and conditions