Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple script, fine in IE not in Firefox.... 2

Status
Not open for further replies.

JamieFuller

Programmer
May 2, 2001
20
GB
Hi All,

Can someone help me, I think i'm losing the plot. I have written a number of javascript assisted pages but when testing them in FF the functionailty doesnt work.

According to all the FF sites all the commands im using are implemented, and if I change the code slighlty it works. but I cant do that. I need it they way it is. Am I doing something stupid ( I bet I am :) )

(please note that all code has been stripped to the most basic elements so it may not make sense as an application)

Anyway heres the code that works in IE but not in FF
Code:
<script language="JScript">
function mclick(which){
 window.location=which;
}
</script>
<table border="0" class="bdr" cellpadding="1" cellspacing="1">
	<tr onClick="mclick('test.htm');">
	 	<td>000091</td>
		<td>16/12/2005</td>
		<td>Normal</td>
		<td>Waiting</td>
	</tr>
</table>


if I change the code to this it works in FF but I need it to do it as part of a larger function.
Code:
<script language="JScript">
function mclick(which){
 alert(which);
}
</script>
<table border="0" class="bdr" cellpadding="1" cellspacing="1">
	<tr onClick="window.location=''test.htm';">
	 	<td>000091</td>
		<td>16/12/2005</td>
		<td>Normal</td>
		<td>Waiting</td>
	</tr>
</table>

Can anyone help?

Kindest Regards
Jamie
 
>[tt]<script language="JScript">[/tt]

JScript is ms designated dialect of javascript. Change it to javascript for broader support meaning moz as well.
[tt]<script language="JavaScript">[/tt]
 
Many Thanks Tsuji,

I new I was doing something stupid :)

Kindest Regards
Jamie
 
I'd use the following:

Code:
<script type="text/javascript">

as it is less likely to cause you validation errors with modern DOCTYPEs than using the language attribute.

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top