PDA

View Full Version : Script Error



weirddemon
12-30-2008, 06:19 PM
I wasn't sure where to put this post because it deals with an Html Application, Javascript, CSS, and VBScript.

This is my code:
<html>
<head>
<title>Test</title>
<HTA:Application
ID = "HTA"
ApplicationName = "Test"
Border = "thin"
BorderStyle = "normal"
Caption = "yes"
ContextMenu="yes"
Icon = ""
InnerBorder="no"
MaximizeButton = "yes"
MinimizeButton = "yes"
Navigable="yes"
Scroll="yes"
SrollFlat="no"
Selection="yes"
ShowInTaskBar = "yes"
SingleInstance = "yes"
SysMenu = "yes"
Version = "1.0"
>

<script type="text/javascript">
self.moveTo(0,0);
self.resizeTo(800,600);
var panels = new Array("","panel1","panel2","panel3","panel4","panel5");

function panel(tab) {
for (i=1; i<panels.length; i++) {
if (i == tab) {
document.getElementById("tab"+i).className = "tabs tabs1";
document.getElementById("panel"+i).style.display = "block";
} else {
document.getElementById("tab"+i).className = "tabs tabs0";
document.getElementById("panel"+i).style.display = "none";
}
}
}

</script>

<script language="VBScript">
Sub RunProgram
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "VBScript1"
End Sub

Sub RunProgram2
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "VBScript2"
End Sub

Sub RunProgram3
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "VBScript3"
End Sub

Sub RunProgram4
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "VBSCript4"
End Sub

Sub RunProgram5
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "VBScript5"
End Sub

Sub RunProgram6
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "VBScript6"
End Sub

Sub RunProgram7
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "VBScript7"
End Sub

Sub RunProgram8
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "VBScript8"
End Sub

Sub RunProgram9
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "VBScript9
End Sub

Sub RunProgram10
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "VBScript10"
End Sub

Sub RunProgram11
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "VBScript11"
End Sub
</script>

<style type="text/css">
body,td,th { font-family:Arial }
.head { font-size:110%; font-weight:bold }
.panel {
background-color: white;
border: solid 1px black;
height: 410px;
padding: 5px;
position: relative;
width: 650px;
z-index: 0;
}

.tabs {
border-collapse: collapse;
color: black;
cursor: pointer;
cursor: hand;
font-family: arial;
font-size: 9pt;
font-weight: bold;
margin-top: 4px;
padding: 2px 4px 0px 4px;
position: relative;
text-align: center;
text-decoration: none;
z-index: 1;
}

.tabs0 {
background-color: wheat;
border: solid 1px black;
}

.tabs1 {
background-color: white;
border-color: black black white black;
border-style: solid solid solid solid;
border-width: 1px 1px 1px 1px;
}

</style>

</head>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="650">
<tr valign="top">
<td align="right" colspan="2">
<span class="head">Polaris v1.3</span> &nbsp; &nbsp;
<br>
</td>
</tr>
<tr valign="top">
<td colspan="2"><span class="tabs tabs1" id="tab1" onclick="panel(1)">General</span>
<span class="tabs tabs0" id="tab2" onclick="panel(2)">Registry Fixes</span>
<span class="tabs tabs0" id="tab3" onclick="panel(3)">Tweaks</span>
<span class="tabs tabs0" id="tab4" onclick="panel(4)">Tab 4</span>
<span class="tabs tabs0" id="tab5" onclick="panel(5)">Tab 5</span>
<div class="panel" id="panel1" style="display:block">
<hr color="black">
<table border="0" width="100%">
<tr valign="top">
<td>
<span class="head">General Tools</span>
<br><br>
<button onclick="RunProgram style="width:180px;">Test1</button><p>
</td>
</tr>
</table>
</div>
<div class="panel" id="panel2" style="display:none">
<hr color="black">
<table border="0" width="100%">
<tr valign="top">
<td>
<span class="head">This is Tab 2.</span>
<br><br>
Maecenas eget massa. Nam auctor. Proin blandit.
</td>
</tr>
</table>
</div>
<div class="panel" id="panel3" style="display:none">
<hr color="black">
<table border="0" width="100%">
<tr valign="top">
<td>
<span class="head">This is Tab 3.</span>
<br><br>
Phasellus mollis iaculis justo. Nullam arcu.
</td>
</tr>
</table>
</div>
<div class="panel" id="panel4" style="display:none">
<hr color="black">
<table border="0" width="100%">
<tr valign="top">
<td>
<span class="head">This is Tab 3.</span>
<br><br>
Phasellus lobortis elit a lacus.
</tr>
</table>
</div>
<div class="panel" id="panel5" style="display:none">
<hr color="black">
<table border="0" width="100%">
<tr valign="top">
<td>
<span class="head">This is Tab 5.</span>
<br><br>
Nunc commodo libero vitae magna.
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>

I originally had the HTA application wit the javascript and CSS and everything worked fine. I added the VBScript code in and I had no problem.

When I added this line, "<button onclick="RunProgram style="width:180px;">Create Restore Point</button><p>", I received a script error on the line that had the onclick event.

Anyone know what I've done wrong?

shyam
12-31-2008, 03:52 PM
I originally had the HTA application wit the javascript and CSS and everything worked fine. I added the VBScript code in and I had no problem.

When I added this line, "<button onclick="RunProgram style="width:180px;">Create Restore Point</button><p>", I received a script error on the line that had the onclick event.

Anyone know what I've done wrong?

its right there in front of you...