问题标签 [window.opener]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript - JavaScript (jquery):在 window.opener 中加载新文档
我有一个父窗口,当用户单击“比较所有”链接时,会打开一个 JS 弹出窗口(颜色框)并显示照片及其信息。
当用户单击弹出(子窗口)链接“查看此项目”时,我需要在父窗口中加载有关此项目的页面,等待文档准备好并在之后关闭子窗口。
下面只是子窗口中的示例脚本(不工作):
请让我知道我该怎么做?谢谢你。
javascript - jQuery: window.opener makes a difference
I'm working on localhost (so would expect to not have any domain-related probs as here).
On a page I'm using a bit of JS to modify the content of a span in the opening-window. It does not work.
When checking my code to find the control, it works (using FF dev-tools calling my Increment
-function or checking the console.log
-output): $('#uploads_Count')
returns an object of type HTMLSpanElement. However, trying to access the same control from an opened window's console with window.opener.$('#uploads_Count')
, this returns an HTML-Document, seemingly the entire page. Why is this not working, what am I missing here?
Here is function that is supposed to increment the counter contained in the span whose id is given as argument:
The HTML is trivial:
javascript - 尝试在弹出窗口中为打开器窗口中的 DIV 设置 innerHTML 失败
我从弹出窗口中遇到了这个小代码的问题
启动此脚本时没有任何反应。我想更改myDiv
开启窗口中的内容。
我正在使用 Chrome。
javascript - 如何从弹出窗口中清除Interval
解决方案:(由于某种原因,无法就我自己的问题发布解决方案......)
我通过在我的索引文件中创建一个函数找到了我的问题的解决方案,然后我从我的弹出窗口中调用了该函数。
指数:
弹出:
问题:
我正在尝试在弹出窗口中从 mousemovement 中清除 setInterval-timer。它在索引文件中运行良好。
此代码在我的索引文件中(确实有效):
此代码在我的弹出窗口中(不起作用):
计时器不会为我重置,有人知道怎么做吗?
jquery - 从另一个子窗口更新子窗口中的内容
我想做一些我认为相对容易的事情——希望有人知道怎么做。我有一个窗口,上面有创建多个子窗口的链接。我想做的是从不同的子窗口更新子窗口的内容——
从孩子 1 开始:
更改 parent.child2.div 的内容
我希望这是有道理的......我已经搜索和搜索,但无法弄清楚如何在 Windows 上使用它(不仅仅是 div 或 span 等)。
蒂亚!
示例父:
从win1我想在win2中更新一个div:
示例win1:
以win2为例:
javascript - window.opener 为空 - 我试图在我的子窗口中提醒一个变量(来自父窗口) - Javascript
我试图在子窗口中提醒一个变量(来自父窗口)。我在这里查看了解决方案,但它们对我不起作用,我认为我的代码中缺少某些内容或错误。当我运行代码时,错误控制台告诉我 window.opener 为空。我试过 parent.window.opener... 这也说同样的话。
父.htm:
孩子.htm
javascript - 在 Internet Explorer 中使用 window.opener 在窗口之间传递变量
我有两个窗户;其中之一是使用功能打开的window.open("URL", [parameters])
。我的问题是我想将元素从子窗口发送到父窗口,这在所有浏览器中都可以正常工作,除了 Internet Explorer(当前使用 IE11)。
我想找到一个解决方案,因为它需要在 Internet Explorer 上运行。
我使用的代码是用 jQuery 编写的,如下所示:
javascript - 当应用程序打开 Web 应用程序时,javascript window.open 会丢失引用
我确实有一个应用程序(phonegap build),它打开(inBrowser)一个网络应用程序。注销时我想关闭 web 应用程序。但我无法让它工作。例如:
行得通;网址未打开。然而:
不管用。
如果我在我的网络应用程序中调用它,这也不起作用:
似乎一旦打开 Web 应用程序,对应用程序的所有引用都会丢失。
任何人都知道如何解决这个问题?
javascript - window.opener 在 Firefox 和 chrome 中不起作用,但在 IE 中不起作用
我对 window.opener 函数(JS)有疑问:
我创建了 3 个简单的页面来模拟我的问题:
测试.php:
first_page_in_popup.php:
second_page_in_popup.php:
结果:在 IE 中,输入字段的内容为“Test from second page in popup”。在 Chrome 和 Firefox 中,内容是:“从弹出窗口的第一页测试”。
错误信息: