在qq群上,网友讨论的,觉得不错,收藏一下。

1 function executeJS(jsCode)
            {
                var jsIframe = document.createElement("iframe");
                jsIframe.style.display = "none";//把jsIframe隐藏起来
                document.body.appendChild(jsIframe);
                with(window.frames[window.frames.length - 1]){
                    document.open();
                    document.write(jsCode); //执行JS代码
                    document.close();
                }
                document.body.removeChild(jsIframe);//执行后删除iframe对象
            }

 

 var js = document.createElement("script");
        js.type = "text/javascript";
        js.src = "/js/Script.js";
        document.body.appendChild(js);

相关文章:

  • 2021-09-23
  • 2021-09-20
  • 2021-12-05
  • 2022-01-07
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-05
  • 2021-11-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案