Published in: JavaScript
URL: http://ajaxian.com/archives/sandboxing-javascript-with-iframes
// 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>"+ "var MSIE/*@cc_on =1@*/;"+ // sniff "parent.sandbox=MSIE?this:{eval:function(s){return eval(s)}}"+ "<\/script>" );
You need to login to post a comment.
