By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,729 Members | 1,340 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,729 IT Pros & Developers. It's quick & easy.

My page doesn't work in firefox

P: 2
I have made a page, and got it to work in IE, but when i tried to open it in firefox it didnt work. I managed to find out the problem, it goes something like this:

Expand|Select|Wrap|Line Numbers
  1. <body onLoad="a();b();c()">
  2. </body>
  3. <script language="javascript">
  4. function a(){
  5. alert("a")
  6. }
  7. function b(){
  8. alert("b")
  9. }
  10. function c(){
  11. alert("c")
  12. }
  13. </script>
  14.  
if this was my code, i would only get one alert saying "a". I tried putting one function in the onLoad embed, and the other functions in it, i.e.

Expand|Select|Wrap|Line Numbers
  1. <body onLoad="d()">
  2. </body>
  3. <script language="javascript">
  4. function d(){
  5. a()
  6. b()
  7. c()
  8. }
  9. </script>
however, this did not work either and i still only got one alert.

any help with this problem would be appreciated.
Oct 31 '07 #1
Share this Question
Share on Google+
5 Replies


dmjpro
100+
P: 2,476
look ..... instead of alerting put some another code then see what happens..

and one more thing use [code=language] instead of <code>.

debasis
Nov 1 '07 #2

acoder
Expert Mod 15k+
P: 16,027
Put your JavaScript in the head section rather than after the body.
Nov 1 '07 #3

P: 2
my code wasn't alerting, i put in alerts to test it, and i used them in the example because it was simpler.

sorry about the code thing, im new to the forum


ill try putting my javascript in the head, thanks.
Nov 1 '07 #4

drhowarddrfine
Expert 5K+
P: 7,435
Just as a note:
There is no such thing as <script language="javascript">

Change it to:
<script type="text/javascript">
Nov 1 '07 #5

P: 41
I have made a page, and got it to work in IE, but when i tried to open it in firefox it didnt work. I managed to find out the problem, it goes something like this:

Expand|Select|Wrap|Line Numbers
  1. <body onLoad="a();b();c()">
  2. </body>
  3. <script language="javascript">
  4. function a(){
  5. alert("a")
  6. }
  7. function b(){
  8. alert("b")
  9. }
  10. function c(){
  11. alert("c")
  12. }
  13. </script>
  14.  
if this was my code, i would only get one alert saying "a". I tried putting one function in the onLoad embed, and the other functions in it, i.e.

Expand|Select|Wrap|Line Numbers
  1. <body onLoad="d()">
  2. </body>
  3. <script language="javascript">
  4. function d(){
  5. a()
  6. b()
  7. c()
  8. }
  9. </script>
however, this did not work either and i still only got one alert.

any help with this problem would be appreciated.
Hi,

Your first code is working fine in both IE and Firefox.
I have run it on my system.

Thanks
Nov 2 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.