EdTheNerd Posted August 1, 2007 Share Posted August 1, 2007 Below is a similar script with the same problem. It is simpler to make it easier to make head or tail of; I'm not really putting anything as silly as this on my website. <html><head><script type="text/javascript">function rofl(){alert('rofl')}function lol(){for (n=0,n<6,n++){alert ('lol')}}</script></head><body><img onclick="rofl()" src="http://www.ubuntu.com/themes/ubuntu07/images/ubuntulogo.png" /></body></html> Kind Regards,Ed Link to comment Share on other sites More sharing options...
jesh Posted August 1, 2007 Share Posted August 1, 2007 It's a syntax error. You're using commas to separate the statements in the for loop rather than semi-colons. The for loop should look like this: for (n=0;n<6;n++){alert ('lol')} Link to comment Share on other sites More sharing options...
EdTheNerd Posted August 2, 2007 Author Share Posted August 2, 2007 Wow that was simple; thanks very much :-) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.