我的 js 弹出窗口有问题.
I have a problem with js popup window.
我打开一个弹出窗口并尝试在另一个页面页面中访问它的元素,没有成功,我不想重新加载弹出窗口源,我只是想访问打开的弹出窗口的一个元素
I open a popup and try to access its elements in another page page, no success, and I don't want to reload the popup source, I simply want access a element of the opened popup
前-
第一页
var popup = window.open("test.html","mypopup","width=500,height=300");
我想在不重新加载弹出窗口的情况下访问 mypopup windows 元素的第二页
2nd page I want to access mypopup windows elements without reloading the popup
我只需要如何在不使用 JS 或 JQuery 中断其来源的情况下访问打开的弹出元素的方式
I only need the way how to access opened popup elements without interrupting its sources using JS or JQuery
同源(域、端口和协议)?
Same origin (domain, port and protocol)?
纯 JS:
来自第 1 页
var popup = window.open("test.html","mypopup","width=500,height=300");
popup.document.getElementById("player").someFunction();
从第 2 页开始
var popup = window.open('','mypopup');
// now popup is known again
popup.document.getElementById("player").someFunction();
这篇关于js 打开弹出窗口并在另一个页面中访问其元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!