• 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

Sentry on Symfony: how to exclude `NotFoundHttpException`

Is there a way to correctly use sanitize_text_field and wp_unslash that doesn't cause psalm to error with "expects string, possibly different type"

protect images from being copied

Converting array to string and then back in PHP

How to Display Data in Yajra Datatables Laravel 7?

XAMPP/SQLSRV: Unable to find Sqlsrv in PHPINFO(); - errors coming from connection

How to connect to MSSQL Server with PHP from Ubuntu 18.04?

What is PHP's equivalent of JavaScript's "array.every()"?

Target Laravelista is not instantiable

PHPExcel export HTML table to xlsx

Invalid value in field "itemtype" in Google Search Console

How to display MySQL table using php and edit it in a web browser

Symfony - EasyAdmin - Add and remove functions are ignored from AssociationField

How to install php_imagick on wamp64

Sagepay Error The Vendor failed to provide a RedirectionURL

About Contact Privacy policy Terms and conditions