Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Apr 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    <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.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Beyond Lament
    Posts
    424
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!·

  • #3
    Regular Coder Skyzyx's Avatar
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>');


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •