迷你组合套件不运行(EVAL)JavaScript的code [英] Tinybox does not run (eval) javascript code

查看:111
本文介绍了迷你组合套件不运行(EVAL)JavaScript的code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的迷你组合套件(http://www.scriptiny.com/2009/05/javascript-popup-box/)为我的弹出操作。

虽然,当我在弹出的加载页面,并在它的脚本标记,这是行不通的。

Anyidea我怎么才能解决这个问题?

例如

 <脚本>
  警报(世界你好);
< / SCRIPT>
 

解决方案

迷你组合套件使用现有的DOM元素的innerHTML属性插入Ajax请求的结果。这就是为什么有不执行的脚本标签。请仔细阅读以下主题可脚本插入的innerHTML?并修改脚本相应地。

例如,这样的..插在tinybox.js 的eval(C); b.innerHTML = C; 部分。或者,你可以按照上面所给出的链接其他建议。

I am using Tinybox (http://www.scriptiny.com/2009/05/javascript-popup-box/) for my popup operations.

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 ?

e.g

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

解决方案

Tinybox uses innerHTML property of the existing DOM element to insert the result of the ajax request. That is why the script tags are not executed. Read carefully the following topic Can scripts be inserted with innerHTML? and modify the script correspondingly.

For example, like this.. insert in the tinybox.js eval(c); after b.innerHTML=c; parts. Or you can follow other recommendations given by the link above.

这篇关于迷你组合套件不运行(EVAL)JavaScript的code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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