hi,
i have a page of asp (jscript) but the CAPTCHA code im using is vbscript. Can i use boths languages on my page? obviosuly i cant use two language tags, is there a way around this?
thanks
| SitePoint Sponsor |



hi,
i have a page of asp (jscript) but the CAPTCHA code im using is vbscript. Can i use boths languages on my page? obviosuly i cant use two language tags, is there a way around this?
thanks





As far as I know you can't INCLUDE jscript in vbscript or vice versa, but you might have some luck with Server.Execute





Yes you can - just use <script runat=server language="jscript">. Example ..
Code:<% 'Some VBScript code goes here %> <script runat=server language="jscript"> // Your JScript code goes here </script> <% 'More VBScript code %>





That's cool.
Can you call functions written in JScript from the VBScript part?





I believe so, yes. Obviously the JScript function part needs to have been created before VBScript can reference it.
Should be very easy to test this.![]()





That's great, never knew you could do that
Code:<% Function Test1() Test1 = "yes" End Function %> <script runat="server" language="jscript"> function test2() { return Test1(); } </script> <% Response.Write test2() %>



great, cheers guys.





There are some things that JScript does better than VBScript (such as array handling), so having this option can really help.





Tell me about it lol.array handling
Plus, it's so easy to transfer complex data from javascript to server using JSON - and I have yet to see a JSON parser written in vbscript.
Bookmarks