...

View Full Version : HTML Script – “ Run Program File ‘if cannot find’ Run URL ”



martydunn
07-18-2011, 04:12 PM
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>

xFinaLx
07-18-2011, 05:47 PM
<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.

Haydendiego
07-19-2011, 01:03 AM
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.

Lerura
07-19-2011, 04:27 AM
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 )

Sammy12
07-19-2011, 07:07 AM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum