English 中文(简体)
使用 Javascript 获取弹出窗口的当前 URL 。
原标题:Get current url of the popup window with javascript

I had a webpage with a link, which opens a new page in a popup window. Everything is fine till here, The popup window contains credit card payment page held by some 3rd party server. After completing the payment flow the response is shown and there is change in the url.

我需要得到那个骨灰盒。

可以写成刺绣吗?

问题回答

页面的 URL 可以通过窗口对象的 < a href="https:// developmenter.mozilla.org/en/DOM/window.replace" rel=“noreferrer” >place 属性访问窗口对象的 < a href="https:// developmenter.mozilla.org/en/DOM/window.place" rel=“noreferr” >place 属性。如果您访问与您相同的子域的某个网站,那么您可以通过该网址获取地址。

popupWindow.location.href

然而,如果弹出来自第三方,则适用