Global object in ASP (calling other scripting languages in ASP pages)

Syver Enstad syver at NOSPAMcyberwatcher.com
Wed Dec 6 08:16:52 EST 2000


> I guess that would be a JS implemted function?
Yes, thats correct.

> Try printing the repr() of your object - you may find it is not a string
> at all, but itself a COM object.  You may be able to just call this
object!

<% @Language=Python %>
<HTML>
<BODY>
<script language=JScript RunAt=Server>
function JscriptFunc()
{
 Response.Write("JScript called");
}
</script>


<%
Response.Write(str(dir()))
Response.Write('<br>')

Response.Write(ScriptingNamespace.JscriptFunc)
Response.Write('<br>')
Response.Write(repr(ScriptingNamespace.JscriptFunc))
Response.Write('<br>')
Response.Write(ScriptingNamespace.JscriptFunc())
Response.Write('<br>')
Response.Write(repr(ScriptingNamespace.JscriptFunc()))
Response.Write('<br>')

%>
</BODY>
</HTML>

Gives the output:

['ASPGLOBALTLB', 'Application', 'ObjectContext', 'Request', 'Response',
'ScriptingNamespace', 'Server', 'Session', '__builtins__', '__doc__',
'__name__', 'ax']
function JscriptFunc() { Response.Write("JScript called"); }
>
function JscriptFunc() { Response.Write("JScript called"); }
u'function JscriptFunc()\015\012{\015\012Response.Write("JScript
called");\015\012}'

>
> Try writing the test function in a different language to see if that
helps.

It does VbScript seems to work fine. Very nice, the downside is that the
site I am working with is written mostly in Jscript.






More information about the Python-list mailing list