window.open

Chrome/Safari: how to open the same window from different tabs or windows

限于喜欢 提交于 2019-12-25 18:13:05
问题 In a web application, I have an optional popup window into which logging content is being loaded. This window is opened via Javascript using window.open() . The users typically have multiple tabs of the application open and my intention is to always reuse the same popup window (if currently open), no matter from which tab they trigger the popup. To do so, I use code similar to this to open the popup: <script> function myFunction() { var myWindow = window.open("popup.html", "my_popup", "width

Window.open only open url, does not click - click has to be done manually

独自空忆成欢 提交于 2019-12-25 17:18:35
问题 I'm using window.open and on click, it opens a new window, pre-fills the address bar but does not open the url filled in the address bar (for chrome) window.open("www.stackoverflow.com","_blank") Is there something that I'm doing wrong. 回答1: You're missing the protocol (in your example http or https ). window.open("https://www.stackoverflow.com","_blank") It's important for the browser to know if you're passing an absolute or relative uri. If it's absolute (like in your case), you have to

javascript to launch only ONE window for a Java applet with a given URL

自作多情 提交于 2019-12-24 08:46:33
问题 I need a javascript solution to launch only one window, with a Java Applet in it, for a given URL. I found a solution posted here on Stack Overflow - here: JavaScript window.open only if the window does not already exist But it doesn't seem to work .. I get Error: launchApplication.winrefs is undefined Line: 29 I can't seem to post the code in this little box and make it look right below, so the code (my working code, plus the solution from above) is here: http://pastie.org/833879 Where is

How can window.closed = true, when the window is open?

让人想犯罪 __ 提交于 2019-12-23 23:51:36
问题 I am stepping through code, and I realized I cannot close a window, because the DispHTMLWindow2 object close property is still to true. if(winObject.closed != true) winObject.close(); The problem is winObject.closed == true, and the window is clearly open. Any ideas where I can look to figure this out? Thanks, Grae UPDATE: I realize this problem may have to do with an embedded PDF. 回答1: It seems as though acrobat reader is keeping the pdf file open on you http://acrobatusers.com/forum

trying to use console of a new window

℡╲_俬逩灬. 提交于 2019-12-23 15:25:20
问题 I'm beginner to learn JS and I am stuck with the following function. I'm trying to open a new window and print in the console of the new window. My code is as follows:Can you please tell me where's the error ? var newWindow = window.open("url"); newWindow.onload = function (newWindow) { newWindow.console.log("...something..."); } 回答1: After the code var newWindow = window.open("url"); It should instantly open another window with "url" path. What happens after is field of work of "url" page.

Open.window in iframe

删除回忆录丶 提交于 2019-12-23 07:30:47
问题 I am making a simple webpage for fun and I am a noob at JavaScript and I want to make windows open up when clicked and I want to open them up inside an iframe and I want to give it all the functionality of a normal window.open and I also want it to maximize the windows but inside the iframe and not outside. I know About the window.open and go it to work I just want to make the windows work inside an iframe and not outside. I am using Notepad for as my editor. This is my first question so

window.open(…) getting blocked in some browsers

我的梦境 提交于 2019-12-23 04:33:42
问题 I have a script where it opens a window for online application after executing some other scripts. window.open() is not called on any click. It is getting called in a script and browser prevents the new window from appearing. How to overcome this? here is the code.. window.open('/search/applyonline?jobid=".$jobDetails->getIdjob()."', 'applyurljob', 'height=550,\ width=800,\ toolbar=no,\ directories=no,\ status=no,\ menubar=no,\ scrollbars=yes,\ resizable=yes,\ left=200,\ top=250') 回答1: Popup

window.open width ignored in Chrome

末鹿安然 提交于 2019-12-22 04:49:16
问题 I want to create a popup of a fixed size, however the width attribute is ignored in Chrome. But Works fine in FF. Here's my code: window.open('','','width=300'); The resultant popup is larger than the given width. Any suggestions? 回答1: I have tried to put this one on Chrome version 25.0.1364.172 window.open('','','width=200,height=100'); and it correspond the exact height and width of the window. to check, please use window.innerHeight; //to display height window.innerWidth; //to display

window.open to center of screen

蹲街弑〆低调 提交于 2019-12-20 12:34:27
问题 I am using window.open to open a popup window like so: <a href="http://path/to/url" onclick="window.open(this.href, 'sharegplus', 'height=485,width=700'); return false;" target="_blank"> I want this to be centered in the screen, but without having to use <script> inline code </script> and merely enter whatever I need within onclick="" . Can this be done? 回答1: Edit This is a bad answer. a much better answer can be found here: window.open() on a multi-monitor/dual-monitor system - where does

Window.open only if the window is not open

和自甴很熟 提交于 2019-12-19 17:24:10
问题 I have a link on my site that opens a new window to a page that plays a very long audio file. My current script works fine to open the page and not refresh if the link is clicked multiple times. However, when I have moved to a seperate page on my site and click this link again, it reloads. I am aware that when the parent element changes, I will lose my variable and thus I will need to open the window, overiding the existing content. I am trying to find a solution around that. I would prefer