Jump to content

need some help with javascript


  • Please log in to reply
5 replies to this topic

#1
SLy CaT

SLy CaT

    InsanelyMac Protégé

  • Members
  • Pip
  • 48 posts
<script language="javascript">
<!---
diecutting=2;
function calculate(){
	if (document.form.diecuttingcheck.checked)
		{var diecuttingmultiple=1}
		else
		{var diecuttingmultiple=0}
var total=(diecutting * diecuttingmultiple); 
document.writeln(total);
}
-->
</script>
<form name="form">
<input type="checkbox" name="diecuttingcheck" onClick="calculate();">
</form>

for some reason, in firefox, it hangs when its outputting the total. there must be something wrong i'm doing... though, not sure what it is =\ anyone see anything wrong?

i'm kind of new to javascript. i hardly used it before. i have more experience with php than javascript U_U;;

#2
kday

kday

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 213 posts
  • Location:Dallas, TX
Works fine for me.

#3
SLy CaT

SLy CaT

    InsanelyMac Protégé

  • Members
  • Pip
  • 48 posts
=\ works in safari, opera, IE, but still seems to attempt to load something after executing the script in firefox (stops halfway).. both mac and windows.

so... that why i thought somethigns wrong. you were using firefox kday?

#4
kday

kday

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 213 posts
  • Location:Dallas, TX
Not sure why. Works in both Win/Mac firefox here. Copied and pasted the code into a blank html document.

Maybe try clearing your cache?

#5
SLy CaT

SLy CaT

    InsanelyMac Protégé

  • Members
  • Pip
  • 48 posts
U_U so weird.. i now tried this on 3 different computers, cache cleared, and all the same result.

Attached Files



#6
acidnine

acidnine

    InsanelyMac Protégé

  • Members
  • PipPip
  • 97 posts
  • Location:Buffalo, MN
What version of firefox?

you have <!--- and you're ending it with -->





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy