• 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

Add New Parameter to Existing URL using htaccess

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

Popup Window and PHP form

Combine array with same value and add other [duplicate]

How to update array value in Laravel

How to change the app environment at run time?

Smarty if isset

I'm trying to write a clean url for my website using the $_SERVER['REQUEST_URI'] in php

Add 2 Webcam in one page with WebcamJS

Image upload not working through ajax Laravel

get data-value with variable value

SMTP ERROR: MAIL FROM command failed: 530 5.7.0 Must issue a STARTTLS command first when using PHPMailer

Match single unknown parameter php (Morse-code Regex)

WooCommerce: Add/display Product or Variation custom field everywhere

Attempt to read property "view" on null when sending password reset email

About Contact Privacy policy Terms and conditions