dqwd71332
2016-03-21 18:56
浏览 141
已采纳

从另一个站点远程调用javascript函数

I have a upload script in another host and after remote file upload with Ajax I call a function like this :

echo '<script language="javascript" type="text/javascript">window.top.window.stopUpload('.$result.' , \'res2\' , uploaded , dkey);</script>';

the stopUpload function in the main page should run and do some thing (show pictures and ...) but I get Permission denied error

Error: Permission denied to access property "stopUpload"

tip : Imagine I have stopUpload function in pageA and I call send file with ajax to upload in my another Host page called pageB I have a stopUpload function in pageB which should run on pageA after upload complete but face to above error ...

Can I call javascript function in another page remotely?

Thanks.

图片转代码服务由CSDN问答提供 功能建议

我在另一台主机上有一个上传脚本,用 Ajax </ code>上传远程文件后我打电话 像这样的函数:</ p>

  echo'&lt; script language =“javascript”type =“text / javascript”&gt; window.top.window.stopUpload('。$ result  。','res2 \',上传,dkey);&lt; / script&gt;'; 
 </ code> </ pre> 
 
 

stopUpload </ code>函数 主页应该运行并做一些事情(显示图片和...) 但是我得到权限被拒绝错误</ p>

 错误:拒绝权限访问属性“stopUpload”
 <  / code> </ pre> 
 
 

提示:</ strong>想象一下,我在 pageA </ code>中有 stopUpload </ code>函数,我用以下方法调用send文件 ajax在我的另一个名为 pageB </ code>的主页中上传我在pageB中有一个 stopUpload </ code>函数,它应该在上传完成后在pageA上运行,但面对上面的错误...... </ p >

我可以远程调用另一个页面中的javascript函数吗?</ p>

谢谢。</ p > </ div>

1条回答 默认 最新

相关推荐 更多相似问题