简体   繁体   English

Tinybox无法运行(EVAL)JavaScript代码

[英]Tinybox does not run (eval) javascript code

I am using Tinybox (http://www.scriptiny.com/2009/05/javascript-popup-box/) for my popup operations. 我正在使用Tinybox(http://www.scriptiny.com/2009/05/javascript-popup-box/)进行弹出操作。

Although, when I load a page in the popup and have a script tag in it, it does not work. 虽然,当我在弹出窗口中加载页面并在其中包含脚本标签时,它不起作用。

Anyidea how I can fix this ? Anyidea我该如何解决?

eg 例如

<script>
  alert('hello world');
</script>

Tinybox uses innerHTML property of the existing DOM element to insert the result of the ajax request. Tinybox使用现有DOM元素的innerHTML属性插入ajax请求的结果。 That is why the script tags are not executed. 这就是为什么不执行脚本标签的原因。 Read carefully the following topic Can scripts be inserted with innerHTML? 仔细阅读以下主题: 脚本可以与innerHTML一起插入吗? and modify the script correspondingly. 并相应地修改脚本。

For example, like this.. insert in the tinybox.js eval(c); 例如,像这样..在tinybox.js中插入eval(c); after b.innerHTML=c; b.innerHTML=c; parts. 部分。 Or you can follow other recommendations given by the link above. 或者,您可以按照上面的链接提供的其他建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM