window.open

Google chrome doesn't take window.name into account

☆樱花仙子☆ 提交于 2019-12-04 04:16:56
问题 I've know that in window.open(url,name... the name basically restricts a browser not to open a popup again , if a popup with the name already exists For example Page A opens popup named "thug" Now I open up a new tab . enter localhost/pageA , and get to see a popup Here is the problem , if i enter the URL localhost/pageA again in a new tab , it'll REOPEN the popup , rather it should have had referenced the earlier popup. because they have the same name Please help 回答1: The JS scripts in two

window.open height isn't the same in Google Chrome as other browsers

自古美人都是妖i 提交于 2019-12-04 03:59:39
I am using javascript's window.open to open a browser window on a user click at a specified width and height (760x581), and this works correctly on Internet Explorer, Safari, and Firefox, but Google Chrome is giving me issues. In the other browsers, the height is correctly used as the height of the content, but in Google Chrome it is making the actual browser window 581 pixels tall instead of the content. Is there a way to fix this? <a href="http://domain.com/example.php" onclick="window.open('http://domain.com/example.php', '', 'width=760, height=581, top=15, left=15, toolbar=0, menubar=0,

window.open not resizable, scrollable

廉价感情. 提交于 2019-12-04 02:36:57
I tried window.open and want the javascript to open a new browser with new url and wants the new window to be resizable and scrollable i tried window.open("someurl", '_blank','windowOpenTab', 'scrollbars=1,resizable=1,width=1000,height=580,left=0, top=0'); Edit1 : tried window.open(url, '_blank','windowOpenTab', 'scrollbars=1,resizable=1,width=1000,height=580,left=0,top=0'); still no luck read about window.open from http://www.javascript-coder.com/window-popup/javascript-window-open.phtml but no luck :( According to MDN you can only have 3 parameters in that function. window.open(strUrl,

IE won't load PDF in a window created with window.open

随声附和 提交于 2019-12-04 00:09:19
Here's the problem, which only occurs in Internet Explorer (IE) . I have a page that has links to several different types of files. Links from these files execute a Javascript function that opens a new window and loads the specific file. This works great, unless the file I need to open in the new window is a PDF in which case the window is blank, even though the URL is in the address field. Refreshing that window using F5 doesn't help. However, if I put the cursor in the address field and press <enter> the PDF loads right up. This problem only occurs in IE. I have seen it in IE 7 and 8 and am

How to catch new window opend by window.open(url, _blank) in PhantomJS?

谁都会走 提交于 2019-12-03 15:58:27
I'd like to check with PhantomJS whether my script correctly opens a new window/tab on click. The open is triggerd by a js event listener and opened through window.open(url, "_blank") . How can I listen for the new window with PhantomJS? There seem to be three ways to do this: onPageCreated CasperJS solves this by using page.onPageCreated . So when window.open is called in the page, a new page is created and page.onPageCreated is triggered with the newly created page. page.open(address, function (status) { if (status !== 'success') { console.log('Unable to load the address!'); phantom.exit();

javascript window.open from callback

做~自己de王妃 提交于 2019-12-03 12:18:06
window.open() called from main thread opens new tab by default. But, here open new window every time (Opera 16 and Google Chrome 29) <input type="button" value="Open" onclick="cb1()"> <script type="text/javascript"> function cb1() { setTimeout(wo, 1000); //simple async } function wo() { var a = window.open("http://google.com", "w2"); a.focus(); } </script> (lol, this is my answer for Open a URL in a new tab (and not a new window) using JavaScript ). How I can open in the tab (by browser default) here? Yogh We ran across this same problem and hunted around SO for an answer. What we found works

How to pass a value from a parent window to another html page using javascript?

有些话、适合烂在心里 提交于 2019-12-03 05:17:44
问题 I have 2 windows home.html and result.html . In home.html I have a <textarea> #txtinput and a <button> #btn . In result.html I have another <textarea> #txtresult . On home.html , if I enter a value into #txtinput and click #btn , I want to open result.html and pass the value of #txtinput into #txtresult . I've tried the below code from another post, which displays the value in the new window's body but won't display it in my element var myWindow = window.open(); myWindow.document.body

window.open without popup blocker using AJAX and manipulating the window.location

梦想与她 提交于 2019-12-03 03:56:47
问题 When dealing with OAuth from the server, such as Twitter and Facebook, you most likely will redirect the user to an URL asking for app permission. Usually, after clicking a link, you send the request to the server, via AJAX, and then return the authorization URL. But when you try to use window.open when the answer is received, your browser blocks the popup, making it useless. Of course, you can just redirect the user to the new URL, but that corrupts the user experience, plus it's annoying.

center window.open on form submit

江枫思渺然 提交于 2019-12-02 21:37:27
问题 My code looks like this: <script type="text/javascript"> function directions(sacred) { var x = screen.width / 2 - 700 / 2; var y = screen.height / 2 - 450 / 2; window.open(sacred.action, 'Directions', 'height=485,width=700,left=' + x + ',top=' + y); return false; } </script> <form action="http://maps.google.com/maps" method="get" target="Directions" onsubmit="return directions(sacred);"> I don't understand js, so take it easy on me if it looks sloppy. I can get this to work fine: <form action

Pass custom arguments to window.open in case of Edge browser

拟墨画扇 提交于 2019-12-02 20:06:33
问题 From a parent window say A, trying to open another window - ChildWindow.htm using window.open. I am unable to pass string value from A. var dialog = window.open("Child_Window.htm?", "title", "width=550px, height= 350px,left=100,top=100,menubar=no,status=no,toolbar=no"); dialog.MyVariable = "some string value"; dialog.opener = window; In Child window, I get window.MyVariable as undefined 回答1: The code snippet shown in the question works fine for Chrome browser. And to pass the context to