Søg i Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

My javascript is not working on Firefox

  • 13 svar
  • 595 har dette problem
  • 56650 visninger
  • Seneste svar af tunjin

more options

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">

Valgt løsning

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.

Læs dette svar i sammenhæng 👍 14

Alle svar (13)

more options

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.

more options

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.

more options

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?

more options

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.

Ændret af ssaccone den

more options

Valgt løsning

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.

more options

hello ssaccone,

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

more options

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

See also Delete browsing, search and download history on Firefox

more options

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

more options

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

more options

You need to use at least id instead of name or document.getElementById to make the code work in Firefox.

<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 id="txtFirstName" type="text">
Enter your Last Name: <input id="txtlastName" onfocus="namechecker()" type="text">
more options

i'm firefox 5.0-6.1-x86-64 javascript not work pupop windows...but firefox 4 was worked... see example site for test javascript chromium is worked... test:http://ns20373.ovh.net/~coyhot/code_Blender.htm try to click on image javascript "javascript:popImage('Gallery/Stills/Code/Blender/patch_Threshold_Setup.jpg','Simple%20setup%20of%20the%20Threshold%20node')" but why???this is very important to be resolve as soon

more options

That popup with KB shows fine here in Firefox 5.

Start Firefox in Troubleshoot Firefox issues using Safe Mode to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).

more options

hello i did safe mode it's work perfect but not-safe mode not work...my addons: -adblock -barlesque -bookmarks menu -cache status -chatzilla -download statusbar -downthemall! -extension opensuse for firefox -feedback -firebug -firefox 4 ui fixer -fireftp -firegestures -flagfox flashgot image-show-hide image zoom pearlcrescent page saver basic right-click-link speed dial empty cache

...where is error?