cancel
Showing results for 
Search instead for 
Did you mean: 

My javascript is not working on Firefox

SOLVED
Highlighted
New User

My javascript is not working on Firefox

I have written a very small javascript. It works perfectly on IE but it is not working on Firefox. Each and every javascript I write, meet the same problem. Javascript is not dissabled in my firefox browser, and I am using the latest version(3.6.9). This is one of my scripts.

<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title>Untitled Document</title> <script language="javascript"> function namechecker() { var firstNameLength = txtFirstName.value.length; while (firstNameLength==0) { firstNameLength=prompt("Enter your First Name",""); txtFirstName.value = firstNameLength; } } </script> Enter your First Name: <input name="txtFirstName" type="text">
Enter your Last Name: <input name="txtlastName" onfocus="namechecker()" type="text">

1 ACCEPTED SOLUTION

Accepted Solutions
New User

Re: My javascript is not working on Firefox

This problem continues to occur for me after updating to 3.6.10. Numerous web sites, even Google, become unusable due to JavaScript errors. The problem can be fixed by clearing the cache. I also noticed that some images for certain pages did not load until the cache was cleared, so I suspect this is not a JavaScript problem but a bug in the way Firefox handles caching. Unfortunately I still cannot systematically reproduce this problem.

This problem occurs on 2 separate machines that are both running Windows 7 Pro 64-bit. Some extensions installed: Firebug (disabled), Xmarks.

One page that I'm trouble with right now is http://cgsmd.isi.edu/dbsnpq. The errors are "$ is not defined", "jQuery is not defined", and some of the images don't show up, while some do show up. When I go to about:cache?device=disk I can located the URL for the JavaScript file. When I follow the links to this cache entry, and I can see that the corresponding cache file does not exist. This is the file:

C:\Users\Scott\AppData\Local\Mozilla\Firefox\Profiles\jlz39414.default\Cache\83E84132d01

I did the same thing for some images. Some I can track down in about:cache and view them, other are listed but the data is not found - these are the ones that did not originally display. In about:cache it claims these items were just cached minutes ago, so it is unlikely some other "cleaning" software is deleting these files.

Conclusion: there are bugs in the Firefox cache system that make many common web sites, such as Google, unusable.

13 REPLIES
New User

Re: My javascript is not working on Firefox

I recently upgraded to Firefox 3.6.9. Today I noticed several web pages no longer work. I see many JavaScript errors in Firebug. They all say "is not defined" or "is undefined". Web sites include: https://www.google.com/analytics, the premier login page at http://dell.com, and one of my own sites. These sites work fine in IE and Chrome . I have not tried yohanrw's script. My system:

Windows 7 Pro 64-bit

These sites are no longer functional. This is a very serious problem.

New User

Re: My javascript is not working on Firefox

When I downgraded to Firefox 3.6.8 all the problems went away. When I upgraded back to 3.6.9, the problem did NOT return. That is, reinstalling 3.6.9 seems to have fixed the problem.

New User

Re: My javascript is not working on Firefox

as " ssaccone " said some of the codes worked on previous versions of Firefox, but not all of them. Is there a way to inform this matter directly to the Firefox team?

New User

Re: My javascript is not working on Firefox

This problem returned after I used my freshly reinstalled 3.6.9 application for 1 day. I first noticed it when clicking "Settings" in a basic Google search page did nothing. Sure enough, many other JavaScript pages then failed with errors like "$ not defined" and "jQuery not defined". However, not all pages failed. For example, a very simple jQuery page with this code worked: $('#myTest').html("<h1>jQuery Works!</h1>"). (I don't know how to insert code in this forum).

This time I was able to solve the problem by simply clearing the cache in Firefox.

Is it possible that one page could alter cached JavaScript on which another page relies, thus disabling the second page?

Note: I am NOT able to systematically reproduce this problem.

New User

Re: My javascript is not working on Firefox

This problem continues to occur for me after updating to 3.6.10. Numerous web sites, even Google, become unusable due to JavaScript errors. The problem can be fixed by clearing the cache. I also noticed that some images for certain pages did not load until the cache was cleared, so I suspect this is not a JavaScript problem but a bug in the way Firefox handles caching. Unfortunately I still cannot systematically reproduce this problem.

This problem occurs on 2 separate machines that are both running Windows 7 Pro 64-bit. Some extensions installed: Firebug (disabled), Xmarks.

One page that I'm trouble with right now is http://cgsmd.isi.edu/dbsnpq. The errors are "$ is not defined", "jQuery is not defined", and some of the images don't show up, while some do show up. When I go to about:cache?device=disk I can located the URL for the JavaScript file. When I follow the links to this cache entry, and I can see that the corresponding cache file does not exist. This is the file:

C:\Users\Scott\AppData\Local\Mozilla\Firefox\Profiles\jlz39414.default\Cache\83E84132d01

I did the same thing for some images. Some I can track down in about:cache and view them, other are listed but the data is not found - these are the ones that did not originally display. In about:cache it claims these items were just cached minutes ago, so it is unlikely some other "cleaning" software is deleting these files.

Conclusion: there are bugs in the Firefox cache system that make many common web sites, such as Google, unusable.

New User

Re: My javascript is not working on Firefox

hello ssaccone,

Sorry for the late reply. Could you please mention me how to clear the cache in FireFox?

Site Moderator

Re: My javascript is not working on Firefox

"Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"

See also Delete browsing, search and download history on Firefox

New User

Re: My javascript is not working on Firefox

Thanks everyone for the help..And I guess Firefox team should constraint about this matter.

New User

Re: My javascript is not working on Firefox

Is this related to a specific bug? I am terrible at sorting through bugzilla.