...

View Full Version : <Applet> tag javascript code problem



vkonstanz
04-11-2003, 11:24 AM
I wounder if smbd can help me.
I try to do the function:
document.writeln('<html><head><title>Turn on/off system</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
document.writeln('<script> function test(){ location.replace("logincont.htm"); } </script>');
document.writeln('</head><body bgcolor="#FFFFFF" text="#000000" onLoad="javascript:setTimeout("test()",5000)">');
document.writeln('asdasdasdasd');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('</body></html>');


but my html document goesn't undestand <applet> </applet> tags.It interpteter the tag as it's own. Is there any symbol, in order to avoid the problem. In the other word I'd like my function to open new document with script inside by I don't know how correctly to set the tag in order not to have confusion with the page.

Quiet Storm
04-12-2003, 12:33 AM
I wonder if "smbd' is even here anymore... I haven't seen them in a while, maybe someone else could help you?
:confused:


:D

Skyzyx
04-12-2003, 12:48 AM
Wow. Just... wow. ;)

Roy Sinclair
04-14-2003, 07:34 PM
You know I ignored this message at first because it talked about an <applet> tag which is something I don't care about. But I finally looked at the posted code and see there's nothing in using that tag at all. The problem with the posted code is actually quite simple, had the message not been posted with an inaccurate and quite misleading subject an answer would likely have been available quite quickly.


Change this line:

document.writeln('<script> function test(){ location.replace("logincont.htm"); } </script>');


to

document.writeln('<" + " script> function test(){ location.replace("logincont.htm"); } <" + "/script>');

and it should work. The key here is that "<script>" and "</script>" should not exist as strings within a script.

Garadon
04-14-2003, 07:46 PM
document.writeln('<html><head><title>Turn on/off system</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
document.writeln("<" + "script> function test(){ location.replace('logincont.htm'); } <" + "/script>");
document.writeln('</head><body bgcolor="#FFFFFF" text="#000000" onLoad="javascript:setTimeout(\'test()\',5000)">');
document.writeln('asdasdasdasd');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('</body></html>');



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum