Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 30th, 2006, 9:04 AM   #1
JPS
Newbie
 
Join Date: Mar 2006
Posts: 1
Rep Power: 0 JPS is on a distinguished road
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?
JPS is offline   Reply With Quote
Old Mar 30th, 2006, 9:14 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Mar 30th, 2006, 10:34 AM   #3
Agent 47
Hobbyist Programmer
 
Agent 47's Avatar
 
Join Date: Nov 2005
Posts: 122
Rep Power: 3 Agent 47 is on a distinguished road
The checkFormat() function should either be inside the JS file
you linked to, or in a set of script tags of it's own.
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet"
Agent 47 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:35 PM.

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