Server-side JavaScript (44)

11 Name: #!/usr/bin/anonymous : 2007-02-28 11:18 ID:zukJm56t

>>8

If we for a second imagine that we have server-side javascript with a print() function:

var a=1,b=2;
var func=function() { alert(a+b); }
print("<html><head><script>\n");
print("var func="+as_code(func)+"\n");
print("func();\n");
print("</script></head><body></body></html>");

This would cause the browser to show an alert saying "3".

This thread has been closed. You cannot post in this thread any longer.