Javascript vbscript challenge

Back to articles

hackvertor

Author:

Gareth Heyes

@hackvertor

Published: Sun, 09 Nov 2008 19:47:59 GMT

Updated: Sat, 22 Mar 2025 15:38:11 GMT

Whilst hacking away in javascript I was experimenting with various things and I thought of a problem which would make a good challenge.

The idea was to produce some vbscript which executed the msgbox function without using parenthesis but the trick was not to raise a syntax error in javascript when parsing the code. I found a cool solution to this but lets see what you can come up with. Here are the main rules:-

Rules

  1. No parenthesis may be used.
  2. The vbscript version must execute msgbox with a argument of 1.
  3. No syntax errors in either vbscript or jscript.
  4. Errors can't be turned off, using window.onerror for example is not allowed.
  5. Both code samples must work in IE7.
  6. The javascript and vbscript code should be identical.

In order to win the challenge you must provide the correct code which executes within the following tags:-

<pre lang="vbscript"> <script type="text/vbscript"> Your vbscript code here </script> <script type="text/javascript"> Your javascript code here </script> </pre>

Back to articles