Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Javascript中通过window.postmessage访问时,如何使用authorize?_Javascript_Ajax_Postmessage - Fatal编程技术网

在Javascript中通过window.postmessage访问时,如何使用authorize?

在Javascript中通过window.postmessage访问时,如何使用authorize?,javascript,ajax,postmessage,Javascript,Ajax,Postmessage,似乎window.postmessage不支持使用用户名和密码进行授权。() 如何在诸如XMLHTTPRequest().open()meethod之类的postmessage中进行授权。() 谢谢。不用了postMessage用于将消息传递到现有帧/窗口。它不会向服务器发起新请求。谢谢。我得到了它。是否有任何方法可以授权使用postMessage而不违反跨源价格。postMessage必须指定一个targetOrigin参数。当目标帧与此参数不匹配时,将不接收消息。onmessage事件接收一

似乎window.postmessage不支持使用用户名和密码进行授权。()

如何在诸如XMLHTTPRequest().open()meethod之类的postmessage中进行授权。()


谢谢。

不用了
postMessage
用于将消息传递到现有帧/窗口。它不会向服务器发起新请求。谢谢。我得到了它。是否有任何方法可以授权使用postMessage而不违反跨源价格。
postMessage
必须指定一个
targetOrigin
参数。当目标帧与此参数不匹配时,将不接收消息。
onmessage
事件接收一个
origin
属性。您可以使用此值查看是否允许源站发出请求。当你控制这两个页面时,你也许能够实现一种授权。我完全理解。我试试那个。谢谢