Server side VB Script & Jscript Clash!!

Results 1 to 2 of 2

Thread: Server side VB Script & Jscript Clash!!

  1. #1
    Join Date
    Dec 1969

    Default Server side VB Script & Jscript Clash!!

    I have a problem..Folks, please help me !<BR><BR>I am instantiating an object in an asp page (say page1.asp) using Jscript. But I could not get the instance of the same object when I write VB script in page2.asp which has page1.asp included in it.<BR>I would like to know, is it possible to get a reference of the object I created using Jscript inside VB script tags<BR><BR>Thanks in advance..<BR><BR>Prasad.<BR>

  2. #2
    Join Date
    Dec 1969

    Default Understanding how...

    The *only* way you can pass JS values to VBS or vice versa is via function calls!<BR><BR>That is, VBS can *not* automatically "see" a JS object (or even a string or number). Period. Only *functions* are visible cross language.<BR><BR>Thus:<BR><BR>&#060;SCRIPT Language=JScript RUNAT=Server&#062;<BR>var lookup = Server.CreateObject("Scripting.Dictionary")<BR>... <BR>function getLookup( )<BR>{<BR>&nbsp; &nbsp; return lookup;<BR>}<BR>...<BR>&#060;/SCRIPT&#062;<BR><BR>&#060;%<BR>&#039; now the VBS code...<BR><BR>...<BR>jsLookup = getLookup( ); &#039; *THE TRICK*<BR>For Each key In jsLookup.Keys <BR>&nbsp; &nbsp; ...<BR>Next<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts