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
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HTML Script – “ Run Program File ‘if cannot find’ Run URL ”

    HTML Script – “ Run Program File ‘if cannot find’ Run URL ”

    I’ve just started learning HTML. I’ve tried to write some script, its not working. Could anyone please help me correct it. Thank you.

    Program File: HomeChannelTV.exe
    URL: www.homechannel.tv/welcome

    SCRIPT

    <html>
    <head>
    <script type="text/javascript" language="javascript">
    {
    function Runfile() {
    WshShell = new ActiveXObject("WScript.Shell")
    WshShell.Run("C:\Program Files\HomeChannelTV.exe", 1, false);
    }

    <else>

    <meta http-equiv="refresh" content="2;
    URL=http://www.homechannel.tv/welcome.htm">
    <meta name="keywords" content="automatic redirection">

    }
    </script>
    </head>
    <body>
    </body>
    </html>

  • #2
    New Coder
    Join Date
    May 2011
    Posts
    79
    Thanks
    3
    Thanked 4 Times in 4 Posts
    <else> is neither an HTML tag or a javascript function. Also, I think you're mixing up VBScript with JavaScript. I don't think JavaScript can execute or modify any files on the client's machine. There are numerous other problems with your JS:

    1. You don't need { and } at the beginning/end of the script.
    2. HTML tags cant be directly referenced from within a script tag. You will need to use the document.write method or something similar to output html.
    3. You can't have an else without an if.

    I don't think you really understand what HTML or JavaScript is. I recommend starting from the basics and getting a good understanding of HTML, and then learn JavaScript.
    Quote Originally Posted by bullant View Post
    Basically - Java is to Javascript as Ham is to Hampster.

  • #3
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    HTML stands for Hyper Text Mark up Language. It is a programming language. The statement of the script should be in scripting form. Script must be prepared in the document form. Script must be made in that form that it looks like a input which has to be entered.

  • #4
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    901
    Thanks
    0
    Thanked 118 Times in 117 Posts
    Quote Originally Posted by Haydendiego View Post
    HTML stands for Hyper Text Mark up Language. It is a programming language. The statement of the script should be in scripting form. Script must be prepared in the document form. Script must be made in that form that it looks like a input which has to be entered.
    HTML is NOT a programming language. It is as the name says, a mark-up language, used to define how text, images etc. is rendered in the users browser.

    Neither HTML nor javascript, can create, edit, delete or execute anything on the users computer ( except cookies )

  • #5
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    your purpose in correcting an error that isnt relevant to the thread?



    http://w3schools.com/html/default.asp
    W3schools is arguably the fastest way to learn html. though it has no relationship with w3


  •  

    Posting Permissions

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