views:

221

answers:

6

I have a strange problem that is only happening in a single location. I am using jQuery and my page is working fine in my machine as well as in other locations. In a single location the page isn't working. I shamelessly asked the client to use Firefox and install Firebug and I am surprised to find that a "jQuery is not a function" error is reported.

It seems that jQuery fails to load. This only happens in the client's office. The client can successfully run the web application from home. What could have caused such a thing to happen? Can a javascript policy be defined in a LAN to block scripts from specific locations? Could it be something wrong with my code?

I have used both local jquery and google references (not both at the same time):

<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"&gt;&lt;/script&gt;
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
A: 

Are you using both at the same time? Just pick one, it may be causing conflicts.

Lucas Jones
I think the poster just showed an example of what he/she tried, not an actual snippet from the page as it is...
WowtaH
+3  A: 

You also need to note the order in which the scripts are executed ... if you have scripts that are trying to run before the jquery libs are included, then you will get this error.

Joel Martinez
Poster says that it works on some locations, so the order of scripts seems to be fine i guess?
WowtaH
+2  A: 
  • Is JavaScript enabled on that one location? This can be disabled by domain policy.
  • Is there some firewall/proxy that is blocking specifics types of content?
  • Is there some firewall/proxy that is blocking specific URL's?
WowtaH
+1  A: 

1) They could be blocking external scripts or certain types of scripts. Are they a Government client per chance?

2) Are you actually loading both scripts in that way? That can cause a conflict.

Jim
A: 

Do some dynamic stuff on your page to choose the appropriate script for the client. Meaning, pick just one. Also, you should put any javascript that relies on jQuery into a block that only executes once jQuery is loaded.

Now that firebug is installed use it to determine if the script was loaded, because a proxy could be blocking the script.

dlamblin
+2  A: 

Have a look with Fiddler (http://www.fiddler2.com/fiddler2/) to see if the .js file is actually being requested and (down)loaded or not. It can also show you the content of requested files so see if e.g. a proxy/firewall altered your .js-files.

WowtaH
This is a good idea, but I've already requested a lot by asking to use Firefox and Firebug.
kgiannakakis
@kgiannakakis in that case put the URL of where JQuery is located in the browser and see what happens.
RichardOD