Javascript vbscript challenge
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
- No parenthesis may be used.
- The vbscript version must execute msgbox with a argument of 1.
- No syntax errors in either vbscript or jscript.
- Errors can't be turned off, using window.onerror for example is not allowed.
- Both code samples must work in IE7.
- 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>