• 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 converting docx to pdf using Unoconv

Laravel print last executed SQL query with Query log

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

How to get values inside <![CDATA[values]] > using php DOM?

get data-value with variable value

merge all files in directory to one text file

WooCommerce: Add/display Product or Variation custom field everywhere

How to validate tin and cst using PHP?

Confirm Leave on External Links in Wordpress

How to add a custom field to all Woocommerce attribute terms using add_action

Laravel relationship belongsToMany with composite primary keys

How to create a cookie to store the timestamp of when a page is first loaded with php

Passing PHP JSON to Javascript: echo json_encode vs echo json declaration

PHPExcel file download using AJAX call

How to keep value of selected value after form submission?

About Contact Privacy policy Terms and conditions