mysterbx Posted May 27, 2009 Share Posted May 27, 2009 Hello, is there a way to stop all ajax processes? i have found how to stop only one... Quote Link to comment https://forums.phpfreaks.com/topic/159913-stop-all-ajax-processes/ Share on other sites More sharing options...
Maq Posted May 27, 2009 Share Posted May 27, 2009 What OS? Quote Link to comment https://forums.phpfreaks.com/topic/159913-stop-all-ajax-processes/#findComment-843441 Share on other sites More sharing options...
mysterbx Posted May 27, 2009 Author Share Posted May 27, 2009 OS name is javascript Quote Link to comment https://forums.phpfreaks.com/topic/159913-stop-all-ajax-processes/#findComment-843453 Share on other sites More sharing options...
Maq Posted May 27, 2009 Share Posted May 27, 2009 OS name is javascript What? Quote Link to comment https://forums.phpfreaks.com/topic/159913-stop-all-ajax-processes/#findComment-843465 Share on other sites More sharing options...
mysterbx Posted May 27, 2009 Author Share Posted May 27, 2009 well i mean im looking for the thing to stop all ajax processes in a javascript... ajax_start=new ActiveXObject("Msxml2.XMLHTTP"); it should work on all os'es Quote Link to comment https://forums.phpfreaks.com/topic/159913-stop-all-ajax-processes/#findComment-843524 Share on other sites More sharing options...
Ken2k7 Posted May 28, 2009 Share Posted May 28, 2009 OS name is javascript What? :D LMAO! That is the best response ever! Quote Link to comment https://forums.phpfreaks.com/topic/159913-stop-all-ajax-processes/#findComment-843710 Share on other sites More sharing options...
Maq Posted May 28, 2009 Share Posted May 28, 2009 OS name is javascript What? :D LMAO! That is the best response ever! Ken, we are all new at some point, and I don't even think he meant it like that... Quote Link to comment https://forums.phpfreaks.com/topic/159913-stop-all-ajax-processes/#findComment-843726 Share on other sites More sharing options...
Ken2k7 Posted May 28, 2009 Share Posted May 28, 2009 Sorry mysterbx. To stop them, I believe there is an abort method. Not sure if it works. Quote Link to comment https://forums.phpfreaks.com/topic/159913-stop-all-ajax-processes/#findComment-843736 Share on other sites More sharing options...
MadTechie Posted May 28, 2009 Share Posted May 28, 2009 Please note this untested The problem is "probably" that when you send a request your replacing ajax_start with the new one thus ajax_start.abort() only stops the last one maybe try var ajax_start= new Array(); function doajax() { ajax_start[ajax_start.length]=new ActiveXObject("Msxml2.XMLHTTP"); } function killall() { for (i=0;i<ajax_start.length;i++) { ajax_start[i].about(); } } Quote Link to comment https://forums.phpfreaks.com/topic/159913-stop-all-ajax-processes/#findComment-843763 Share on other sites More sharing options...
Ken2k7 Posted May 28, 2009 Share Posted May 28, 2009 abort(), not about(). And it's recommended to store ajax_start.length as a var. Quote Link to comment https://forums.phpfreaks.com/topic/159913-stop-all-ajax-processes/#findComment-843881 Share on other sites More sharing options...
mysterbx Posted May 28, 2009 Author Share Posted May 28, 2009 the ajax_start.length is undefined... ajax_start is not global, its in a function function do_ajax(){ ajax_start=""; // do it } that might be a problem, is there a way to bypass it? Quote Link to comment https://forums.phpfreaks.com/topic/159913-stop-all-ajax-processes/#findComment-844113 Share on other sites More sharing options...
Ken2k7 Posted May 28, 2009 Share Posted May 28, 2009 Take that line out of the function. Look at MadTechie's example. Quote Link to comment https://forums.phpfreaks.com/topic/159913-stop-all-ajax-processes/#findComment-844160 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.