Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-11-2003, 10:24 AM   PM User | #1
vkonstanz
New to the CF scene

 
Join Date: Apr 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
vkonstanz is an unknown quantity at this point
<Applet> tag javascript code problem

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.
vkonstanz is offline   Reply With Quote
Old 04-11-2003, 11:33 PM   PM User | #2
Quiet Storm
Regular Coder

 
Join Date: Jun 2002
Location: Beyond Lament
Posts: 424
Thanks: 0
Thanked 0 Times in 0 Posts
Quiet Storm is an unknown quantity at this point
I wonder if "smbd' is even here anymore... I haven't seen them in a while, maybe someone else could help you?



__________________
Quíet Storm Designs ~ Art is not what you see, but what you make others see.
· the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·
Quiet Storm is offline   Reply With Quote
Old 04-11-2003, 11:48 PM   PM User | #3
Skyzyx
Regular Coder

 
Skyzyx's Avatar
 
Join Date: Aug 2002
Location: Silicon Valley, CA
Posts: 980
Thanks: 0
Thanked 0 Times in 0 Posts
Skyzyx is on a distinguished road
Wow. Just... wow.
__________________

Creator of SimplePie and Tarzan AWS, co-founder of WarpShare, co-built the Y! Messenger website, usability-focused, and an INFJ personality.
Skyzyx is offline   Reply With Quote
Old 04-14-2003, 06:34 PM   PM User | #4
Roy Sinclair
Senior Coder

 
Join Date: Jun 2002
Location: Wichita
Posts: 3,880
Thanks: 0
Thanked 0 Times in 0 Posts
Roy Sinclair will become famous soon enough
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.
Roy Sinclair is offline   Reply With Quote
Old 04-14-2003, 06:46 PM   PM User | #5
Garadon
Regular Coder

 
Join Date: Jul 2002
Posts: 698
Thanks: 0
Thanked 0 Times in 0 Posts
Garadon is an unknown quantity at this point
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>');
Garadon is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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


All times are GMT +1. The time now is 08:41 PM.


Advertisement
Log in to turn off these ads.