tags:

views:

129

answers:

2

Hi all

I've set document.ready in the middle of a page.

It was working fine on local server, on an online production beta server, but failed on the final server.

Any suggestions?

thx

Code:

$(document).ready(function() {

And yes. JQuery is loading and it's working propely

+2  A: 

The most likely problem is the production server doesn't have a copy of jquery. Switching to having google provide jquery for you is a good practice.

Yuriy Faktorovich
uh.... no. Premature optimization. Just seems bad to rely on an outside source for something so integral to the site.
DGM
@DGM: I'd say if google went down the internet would die, at least temporarily. On the other hand lets say they disabled this service, which caused your site to have some downtime. I'd say the speed benefits and current reliability outweigh that con by far.
Yuriy Faktorovich
@DGM: Yuriy is right. There is absolutely nothing wrong with using Google CDN's hosted version of jQuery (or any other library for that matter). Also, there's a good chance that the library may be cached on the users computer, making it faster to load and saving bandwidth.
BenTheDesigner
+4  A: 

Get Firebug and check:

  • is jQuery loading or is it missing. And is it loaded before the document.ready ?
  • is the script throwing any JavaScript-errors?
Hippo
+1 Web development without firebug is like driving blindfolded
T. Stone