Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simultaneous ajax with jquery

Status
Not open for further replies.

JBellTek

Programmer
Jun 11, 2009
29
US
Good day

I am working on a script which paginates an sql resultset and provides an XLS download. I want the users to be able to page through the results while their file is being built. I have this working, except it doesn't actually process the "page changes" until after the file is finished building, which defeats the purpose.

Does anyone here know how to make the xls file build allow the other faster results to execute? Basically I want it to happen in the background, but it is forcing everything else to wait.

Here's the javascript calls that I am currently using:
Code:
function loadContent (offsett) {
	 $('#content').load('mmiteminqcltic.php', {offset: offsett, x: (new Date()).getTime()});
}
function mkDlFile ()  {
	 $('#download').load('mmiteminqcltdl.php', {x: (new Date()).getTime()});
}
$(document).ready(function(){
	loadContent ();

	 $(".goFirst").live("click", function(){
		 offset = 0;
	 	 loadContent (offset);
	 });

	 $('.goPrev').live("click", function(){
		 offset = offset - 15;
	 	 loadContent (offset);
	 });

	 $('.goNext').live("click", function(){
		 offset = offset + 15;
	 	 loadContent (offset);
	 });

	 $('.goLast').live("click", function(){
		 offset = offset + 15;
	 	 loadContent (offset);
	 });

	 $('#loading').hide()  // hide it initially
	 .ajaxStart(function() {
	 	 $(this).show();
	 })
	 .ajaxStop(function() {
	 	 $(this).hide();
	 });
	 $("#content").ajaxStop(function () {
	 });
	 mkDlFile ();
});

I have been crawling through documentation and forums looking for an answer to this for a while now, any insights would be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top