Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to Loading php file one by one?

  $('#demo').html('<img src="/parcel-pricer/img/ajax-loader.gif" style="margin-left:50px;width:20%;margin-bottom:10px;">');
$('#demo').show();
$('#demo').load('fast.php?send='+send+'&delv='+delv+'&quant='+quant+'&weight='+weight+'&length='+length+'&width='+width+'&height='+height+'&send1='+send1+'&delv1='+delv1+'&value='+value+'&country_send='+country_send+'&country_delv='+country_delv);
$('#demo1').html('<img src="/parcel-pricer/img/ajax-loader.gif" style="margin-left:50px;width:20%;margin-bottom:10px;">');
$('#demo1').show();
$('#demo1').load('Timed.php?send='+send+'&delv='+delv+'&quant='+quant+'&weight='+weight+'&length='+length+'&width='+width+'&height='+height+'&send1='+send1+'&delv1='+delv1+'&value='+value+'&country_send='+country_send+'&country_delv='+country_delv);

i am load multiple php file using .load() function. all file are load for some time but php file not load for one time his load for by one by one.. so plz how is ???

like image 276
Piyush Trivedi Avatar asked Jul 08 '16 13:07

Piyush Trivedi


People also ask

How do I join two PHP files?

It is possible to insert the content of one PHP file into another PHP file (before the server executes it), with the include or require statement. The include and require statements are identical, except upon failure: require will produce a fatal error (E_COMPILE_ERROR) and stop the script.

Does PHP run first?

Pragmatically speaking, this is the typical order: PHP runs first and constructs the page. The browser loads the resulting HTML (any JavaScript found gets executed immediately)

Can you combine JS and PHP?

- There are two ways to combine PHP with JavaScript to achieve a dynamic and personalized result: 1) By writing the entire JS script within PHP code and adding it to the web page with PHP function ' echo ' (or ' print ').


1 Answers

Try using the callbacks like:

// load to first target div
$( "#target_1" ).load( "url_1", function() {
    // load to second target div
    $( "#target_2" ).load( "url_2", function() {
         // ... and so on if any
    });
});
like image 196
Sherin Jose Avatar answered Sep 27 '22 21:09

Sherin Jose