JavaScript 安全错误
我使用这个 JS 命令打开新的对话框窗口,并传递参数以在新打开的窗口中使用它们。但是我在 firebug 中遇到 SecurityError 。
var param1= "Internal";
var param2= "Saved";
var url = "http://localhost:8080/player/bin/index.html"
functon callPlayer(){
newWindow = window.openDialog(url, "Hello", "", param1, param2);
}
可能是什么原因导致了这个问题?
是否有可能以某种方式使用基本的 window.open 方法发送可在新窗口中使用的 JS 参数(或者可能使用 document.write 或 innerHTML)?
我使用FlashDevelop,因此它有一个bin文件夹,其中包含index.html文件,该文件在新窗口中加载(index.html在其中加载swf)。所以基本上我希望在窗口中加载 swf 播放器,但我需要来自数据库服务器的 JS 参数,这就是为什么我想将参数发送到新窗口。 (我必须使用新窗口,因为我有带有行的网格,并且每一行都会打开带有其他参数的新窗口)
I am using this JS command to openn new dialog window and btw pass parameters to use them in the newly opened window. However I get SecurityError in firebug.
var param1= "Internal";
var param2= "Saved";
var url = "http://localhost:8080/player/bin/index.html"
functon callPlayer(){
newWindow = window.openDialog(url, "Hello", "", param1, param2);
}
What could be causing the problem?
Also is it possible somehow with the basic window.open method to send JS parameters that can be used in the new window (or maybe with document.write or innerHTML)?
I use FlashDevelop so it has bin folder with index.html file which is loaded in the new window (index.html loads the swf in it). So basically I want the swf player loaded in the window, but I need parameters from JS which come from database server so that why i want to send params to the new window. (An I must use new window coz I have grid with rows, and every row opens ne window with other parameters)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决了这样的问题:我使用了
window.open
而不是window.openDialog
,在那之后我设置了手动窗口参数,如下所示:对于安全错误,我仍然得到使用
openDialog
时会出现此情况。不知道为什么。I solved the problem like this: I used
window.open
notwindow.openDialog
and after that line I setup manualiy window parameters like this:And for the Security error I still get it when using
openDialog
. Not sure why.