Sorry, all the code in my thread post is meant to be server-side. So if
there is not a RUNAT="Server" in the SCRIPT tag then I just forgot and
it should be written. Please have in mind this is all to do with
server-side scripting.
andrewwan1980 wrote:
*How can VBScript code access JScript code variables in the same ASP
page?
<SCRIPT LANGAUGE="VBScript">
Dim a
a = 10
</SCRIPT>
<SCRIPT LANGUAGE="JScript">
Response.Write(a);
</SCRIPT>
Also, is this valid JScript code because ASP hasn't complained.
<SCRIPT LANGUAGE="JScript">
function Section(a, b, c, d) {
this.a = a;
this.memFunction = function() {
this.a = this.a + 1;
}
}
</SCRIPT>
Basically it's like JScript's way of declaring classes.
How can VBScript code create a Section object?
<SCRIPT LANGUAGE="VBScript">
Dim obj
obj = new Section 'Error, says cannot find Section
obj = new Section() 'Error again
obj = new Section(1, 2, 3, 4) 'Error again
</SCRIPT>
Also, is it possible to nest <SCRIPTtag inside <% %>? Like:
<%
'Some VBScript code
Class AClass
Private a
Function b()
End Function
%>
<!-- #INCLUDE VIRTUAL="JScript.asp" -->
<%
End Class
%>
where JScript.asp has:
<SCRIPT LANGUAGE="JScript">
function Section() {
function Section2() {
}
}
</SCRIPT>
ASP didn't complain. But couldn't test whether the JScript functions
Section were member functions of the VBScript AClass. *
--
andrewwan1980
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------