Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   JavaScript and Client-Side Browser Scripting (http://www.programmingforums.org/forum23.html)
-   -   JavaScript and Firefox (http://www.programmingforums.org/showthread.php?t=9124)

JPS Mar 30th, 2006 9:04 AM

JavaScript and Firefox
 
Hi Everyone,

I am kinda new to JavaScript, but have been playing with it for work and my own fun.

One think I noticed is that Firefox 1.5 won't allow me to call a function unless its for an event link onclick?
E.g.
I got a form that has the fields format, delivery, and email_address. just below this form I place the script code.
:

       
<script language="javascript1.4" type="text/javascript" src="javascript/grp_e.js>
  checkFormat();
</script>

now IE will run this function (which does some checking for me). Firefox won't execute this function though? But if I put the body of the function in place of the checkFormat call then both Firefox and IE will run the script. I'm just curious as to why the developers of Firefox would have it this way?

DaWei Mar 30th, 2006 9:14 AM

Dunno, never tried it like that. I put my definitions (whether direct are via .js file) in the head area and the invocations where I need 'em. Possibly the call occurs before the definition is completely read in and stored with Firefox.

Agent 47 Mar 30th, 2006 10:34 AM

The checkFormat() function should either be inside the JS file
you linked to, or in a set of script tags of it's own.


All times are GMT -5. The time now is 11:09 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC