robert hahn

a darn good web developer

November 23, 2005

How to use JScript instead of VBScript in ASP

This tip does exist elsewhere in the net, but the best reference I’ve seen is buried in the middle of a page. And I’d link to it, but I can’t find it any more. However, while re-researching the topic, I found this page which will serve in a pinch. Hopefully this article title will help fellow Web Developers with JavaScript experience, but not VBScript experience, code their pages using JScript.

Ready for the tip? Ok, here goes. At the top of the page that you want to code, OR just before a block of code which is written in JScript, add this line:

<%@ LANGUAGE="JSCRIPT" %>

That’s it. Once you do that, any code following that line is going to be sent to the JScript parser.

If you’re wondering at my curious phrasing, here’s the explanation. Apparently (and I did not learn this until recently) you can mix JScript and VBScript on the same page, and you can, in a limited fashion, even share variables and call functions written in the other language. I don’t understand exactly how that works, but this knowledge might be Good For You to Know.

decorative image of trees

Copyright © 2009
Robert Hahn.
All Rights Reserved unless otherwise indicated.