我正在开发一个小部件。
它的代码如下:
我想像传递查询字符串一样将参数传递给.js文件。
请注意 Iframe 中的 src 内容,它包含:
现在我想将这些JS字符串中的参数作为查询字符串传递给此 src 。
<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的新手,需要帮助。