Go Back   CodingForums.com > :: Client side development > HTML & CSS

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 07-18-2011, 03:12 PM   PM User | #1
martydunn
New to the CF scene

 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
martydunn is an unknown quantity at this point
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>
martydunn is offline   Reply With Quote
Old 07-18-2011, 04:47 PM   PM User | #2
xFinaLx
New Coder

 
Join Date: May 2011
Posts: 79
Thanks: 3
Thanked 4 Times in 4 Posts
xFinaLx is an unknown quantity at this point
<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.
xFinaLx is offline   Reply With Quote
Old 07-19-2011, 12:03 AM   PM User | #3
Haydendiego
New to the CF scene

 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Haydendiego is an unknown quantity at this point
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.
Haydendiego is offline   Reply With Quote
Old 07-19-2011, 03:27 AM   PM User | #4
Lerura
Regular Coder

 
Lerura's Avatar
 
Join Date: Aug 2005
Location: Denmark
Posts: 869
Thanks: 0
Thanked 112 Times in 111 Posts
Lerura will become famous soon enough
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 )
Lerura is offline   Reply With Quote
Old 07-19-2011, 06:07 AM   PM User | #5
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
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
Sammy12 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 07:02 AM.


Advertisement
Log in to turn off these ads.