question on: HTA and format to include external script file
- From: "James" <noone@xxxxxxxxxxx>
- Date: Thu, 23 Oct 2008 10:31:12 -0400
Noticed when playing with HTA that this:
<SCRIPT Language="VBScript" src="testinc.vbs"/>
caused problems but this:
<SCRIPT Language="VBScript" src="testinc.vbs"></script>
did not?
specifics on the problem one:
the include file *is* still included and I can call procedures from it from
within the main HTA's <script> section but I can't call procedures that are
actually defined *in* the main HTA's <script> section? error is: Type
Mismatch: 'procedurename'. Obviously 'procedurename' is the name of the
function or sub being called.
1. wanted to confirm this is by design and I don't need an update or
something?
2. is this specific to HTA's? or is it the same when using scripts in
regular web pages?
3. general enlightenment on this is greatly desired.
here is example of what I'm talking about. In the code below when the hta is
opened the Window_Onload procedure is not run, no error, and when you click
the button which simply calls the Window_Onload procedure you get the type
mismatch error. If you change the way you include testinc.vbs file to:
<SCRIPT Language="VBScript" src="testinc.vbs"></script>
then there is no problem. Note: example is not using anything from the
testinc.vbs file, its just the structure of how its included that is
relevant.
--------------------
<html>
<head>
<title>HTA Helpomatic</title>
<HTA:APPLICATION
ID="objHTAHelpomatic"
APPLICATIONNAME="HTAHelpomatic"
SCROLL="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="maximize"
<SCRIPT Language="VBScript" src="testinc.vbs"/>
<SCRIPT Language="VBScript">
Sub Window_Onload
Msgbox "The application has started."
End Sub
</SCRIPT>
</head>
<body>
<h1>In the body</h1>
<input type="button" value="test" onclick="Window_Onload">
</body>
</html>
---------------------
.
- Follow-Ups:
- Re: question on: HTA and format to include external script file
- From: gimme_this_gimme_that@xxxxxxxxx
- Re: question on: HTA and format to include external script file
- From: gimme_this_gimme_that@xxxxxxxxx
- Re: question on: HTA and format to include external script file
- From: mayayana
- Re: question on: HTA and format to include external script file
- Prev by Date: Help me to populate MSDatagrid
- Next by Date: Re: question on: HTA and format to include external script file
- Previous by thread: Help me to populate MSDatagrid
- Next by thread: Re: question on: HTA and format to include external script file
- Index(es):
Relevant Pages
|