/ Published in: JavaScript

URL: http://ajaxian.com/archives/sandboxing-javascript-with-iframes
Expand |
Embed | Plain Text
// create an <iframe> var iframe = document.createElement("iframe"); iframe.style.display = "none"; document.body.appendChild(iframe); // write a script into the </iframe><iframe> and create the sandbox frames[frames.length - 1].document.write( "<script>"+ "parent.sandbox=MSIE?this:{eval:function(s){return eval(s)}}"+ "<\/script>" );
You need to login to post a comment.