Jump to content

Ajax fine when Firebug is enabled, breaks when disabled??


susanBuck

Recommended Posts

My Ajax is working fine in Safari and Firefox when Firebug is enabled...But when Firebug is disabled or not installed, it breaks.

 

It's a common problem I've found on Google - apparently its a bug in Firefox that is being covered by something Firebug is doing, hence things working fine when Firebug is enabled.

Here's a couple of sites talking about this problem :

http://lukav.com/wordpress/2007/04/12/firefox-firebug-and-synchronos-calls-problem/

http://www.coachwei.com/blog/_archives/2007/11/17/3358362.html

 

But despite the info i've found, I still haven't figured out whats going on.

 

Originally I was using the w3schools example code (http://www.w3schools.com/Ajax/ajax_server.asp), but then I just switched to the mootools ajax class thinking that would help - but its doing the same thing.

 

here's what my code looks like


/* --------------------------------------------------
ajaxMagic
---------------------------------------------------
processUrl = the name of the php page which is doing processing
params     = an array of query strings to to be sent to the php page
ex. params array may look like this:
params[0] = "action=add";
params[1] = "note=butterscotch";
params[2] = "tags=dogs,cats,birds";
resultsTargetId = where the results should be put...div
*/
function ajaxMagic(processUrl,params,resultsTargetId,loaderDiv){	

var queryStrings = "";

// Take each item in params and make it part of the query string
for(var i = 0; i < params.length; i++) {
	queryStrings += params[i] + "&";
}	

// remove the & off the end
var queryString = queryStrings.substring(0,queryStrings.length-1);

// Append the query strings to the processUrl
processUrl = processUrl + "?" + queryStrings;

// Run the Ajax
new Ajax(processUrl, {
	method: 'get',
	update: $(resultsTargetId)
}).request();
    
} // end ajaxMagic();

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.