• 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

Unable to guess the mime type as no guessers are available Laravel 5.2

PHPS source file - 403 Forbidden You don't have permission to access this resource

Prevent blank space in pdf pages (DomPdf)

Sentry + Laravel: how to log an already catched Exception?

How to redirect to another page and call a Function there on Angular ng-click

how to use extended ASCII instead of unicode in PHP

How can I make Laravel return a custom error for a JSON REST API

I want a way to give path to my files which are outside of public folder in laravel

PHP-Sort array based on another array?

CodeIgniter extend CI_URI undefined method

Edit product hook WooCommerce

Match csv filenames to table names and import

echo language construct is discouraged. (PHP)

Creating command to backup MySql database in Laravel

correct PHP headers for pdf file download

About Contact Privacy policy Terms and conditions