$.ajax not working on a Mac
Ok, here's the deal. I am working on a website that makes use of the $.ajax function. Everything works great in Windows. I've tested it in Firefox, Safari, IE, Opera, and Chrome with no problems.
I pulled up the site in Firefox on my Mac and nothing that $.ajax loads appeared. I clicked around on some other items that would trigger event-based loads. The animation triggered, telling me that $.ajax reported a success. However, the box that loaded was blank, as if the external PHP was a blank file.
Thinking that it might be a Firefox issue, I tried the same experiment in Opera and Safari, and I got the same results.
Here's a list of things I've already to tried:
- jQuery Documentation (to make sure I used the function right)
- JSLint (fixed most errors; JSLint doesn't seem to like arrays)
- File permissions (tried 644, 755, 777)
- Changed to absolute files paths to avoid MOD_REWRITE confusion
Here is a sample of my code. This is not the complete object, but is enough to give an idea, and it contains an offending section. The function call here would be 'user.login.make()' and it makes use of 'prefs' object to get all of its information (e.g. prefs.basename returns 'http://www.domain.com'). The only code I am using here is jQuery and things I've written, no other plugins or libraries.
- var user =
- {
login:
{
make: function()
{
// append '#login-content-inside' to body, reposition
$.ajax({
url: prefs.basename + prefs.paths.resourceDirectory + prefs.paths.php + "user.login.form.php?r=" + window.location,
success: function(data)
{
$("#login-content-inside").html(data);
$("#login-form").animate({top:"0px"}, prefs.transitionSpeed);
user.login.open = true;
},
error: function(xhr, textStatus, errorThrown)
{
error.warn("Error: " + page.httpStatus(xhr.status));
}
});
}
}
};
Any help or ideas would be greatly appreciated.