【发布时间】:2015-02-15 19:00:01
【问题描述】:
我正在开发一个小部件。 它的代码是:
<script src="../test/js.js"></script>
我想将参数传递给这样的 .js 文件,因为我们传递查询字符串等参数。
<script src="../test/js.js?place=us&list=10"></script>.
这些是我的 .js 文件中的内容。
var _html = '<div id="FJ_TF_Cont" style="position: relative; padding: 0; margin: 0; border-width: 0px; width: 200px;">'
+ '<iframe width="210" height="640" src="../test/content.aspx" name="FJIframe" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" style="width: 210px; border-width: 0px; z-index: 1;">'
+ '</iframe>'
+ '</div>';
document.write(_html);
请注意 Iframe 中 src 的内容,它包含:
src="../test/content.aspx"
现在我想将 js 字符串中的这些参数作为查询字符串传递给这个 src。
最终的 src 应该是这样的:
src="../test/content.aspx?place=us&list=0"
我是 js 新手,需要帮助。
【问题讨论】:
标签: javascript