• 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

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

Utf8 encoding issue with Laravel

Laravel relationship belongsToMany with composite primary keys

Access relation of pivot table in Laravel

Laravel 8: Array to string conversion while calling route:list

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

Pass an image through AJAX [duplicate]

I want to display default profile image if user do not have profile image

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

Installing Composer - Internal Error

How to run or debug php on Visual Studio Code (VSCode)

Transpose csv file data [duplicate]

get attribute from class not working php 7

Best way to scrolldown onpageload

oauth-private.key does not exist or is not readable

About Contact Privacy policy Terms and conditions