重新插入< script>标签 [英] Re-insertion of <script> tags

查看:93
本文介绍了重新插入< script>标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 插入文件的标签,从而执行文件的代码.
  2. 删除文件的标签.
  3. 插入相同文件的标签.

当以前已经插入文件时,

Firebug似乎不认可并且不显示 re 插入的标签.当然,它是在新插入的时候完成的.

Firebug does not seem to acknowledge and does not show the reinserted tag when the file's has already been inserted before. It does upon new insertions, of course.

这是某种问题吗? (该文件显然仍会重新加载,但我的测试仅依赖于记录一些简单的内容)

Is this a problem of some kind? (the file still reloads apparently, but my tests only rely on logging some simple stuff)

推荐答案

简单地跳过代码就足以满足您的目的了吗?

Would simply evaling the code be sufficient for your purposes?

eval(script_element.innerText);

更新:重新添加脚本似乎可行.

Update: Reappending the script seems to work.

这篇关于重新插入< script>标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆