window.open

javascript/jquery open.window popup fires onunload after about:blank unloads

你离开我真会死。 提交于 2019-12-10 22:33:37
问题 Let's say I have a button that opens a popup with window.open(): <button id = "my-button">Open window</button>​ And I want to capture when this window closes. I use the following code: $('#my-button').on('click', function() { popup = window.open('http://www.google.com', 'my_popup', "width=800,height=600,scrollbars=no,resizable=yes,status=yes,toolbar=no,location=no,menubar=no"); $(popup.document).ready(function() { console.log('ready!'); $(popup).on('unload', function() { console.log('unloaded

IPAD safari browser does not support the window.open JavaScript method

点点圈 提交于 2019-12-10 21:58:00
问题 I want to call the window.open method in JavaScript code on an iPad. When I call that method, it works fine. Now I want to return a value from the HTML page which is opened by the window.load method. It returns values in other browsers, but it is not returning a value in the iPad Safari browser. 回答1: Unlike most browsers, the tabs in Safari on the iPad can't communicate with each other. You should rethink your interface to avoid window.open if you can and instead use an HTML-based dialog that

window.open() should open the link in same tab

痞子三分冷 提交于 2019-12-10 20:56:48
问题 I am very new to javascript, and written a program that will open a querystring as link. I used window.open() , but the link is opening in new tab, I want to open this link in the same tab. The code is below. var strquerystring; if(fromvalue==""||tovalue==""){ alert('kindly fill all the details'); }else{ window.open(strquerystring); } 回答1: Use location.href = strquerystring; Instead of window.open. It will then change the current URL. 回答2: You need to use the name attribute: window.open("www

Avoiding duplicate browser tabs or windows (window.open())

£可爱£侵袭症+ 提交于 2019-12-10 18:55:32
问题 In Javascript, we can use window.open() to open a new browser window or tab. But if a tab is already open, it should highlight that only. It should not open duplicate tabs. How to do that? 回答1: The second argument of window.open(strUrl, strWindowName[, strWindowFeatures]); is the window name. if you specify that parameter, to anything other than "_blank" it will refer to the already opened tab/window. For instance: window.open('/about', 'newwindow'); and window.open('/contact', 'newwindow');

window.open to pass parameters to php and trigger pdf creation and view

ε祈祈猫儿з 提交于 2019-12-10 10:43:50
问题 I've been using window.open to point to a php file where I create a pdf on the fly using fpdf and display it immediately to the user. Seems to work fine across all browsers and even mobile devices. For example: window.open('/client/feature_Schedule/scheduleReport.php','Schedule_Report','width=900,height=600,status=yes'); I'm not passing any values in this example because all of the parameters needed already exist in the php file. But now I'd like to pass values from javascript along in order

Close opened pop-up window on form submission and trigger click on the parent window

吃可爱长大的小学妹 提交于 2019-12-10 09:26:35
问题 I have a parent window from where I am opening a pop-up window using window.open() and I am monitoring the return of that pop-up window using the window.opener method. I have two queries here: On my pop-up window, there is a submit button that takes care of the submit functionality of the form and I would like to wait for the submit to complete and close this pop-up window on submission. When the form is submitted and the pop-up window is closed, I am fetching one of the text box values and

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

六月ゝ 毕业季﹏ 提交于 2019-12-09 16:30:56
问题 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

IE 8下的window.open

谁说胖子不能爱 提交于 2019-12-09 13:35:30
在IE8下window.open报了一个错误,invalid parameter,但是参数明明没有错误。 一般说来,第二个参数中不能具有空格和“-”这两个符号。但是我的参数中也没有写这个。怪哉! 后来发现问题所在,原来有一个“newwindow”+Math.random()这个作为参数的时候,Math.random会产生小数点符号“.” 在IE8下,window.open不应该出现点号。所以不能这样来获取随机数,那么换一个获取随机数字的方式。 new Date() - 0,用时间来获取随机数 当然不是必须规定随机数,随机字符串未尝不可,所以: Math.random().toString(36).substring(7); Math.random().toString(36).slice(2); (newDate()-0).toString(36) 这些获取随机字符串的方式都不错。 记住:IE8下:window.open第二个参数中不能有空格“ ”,中划线“-”,点号“.” 来源: oschina 链接: https://my.oschina.net/u/1431510/blog/370161

Iframe/Popup redirecting opener window

可紊 提交于 2019-12-08 12:20:45
问题 I have a page located at x.com. On this page is a button that, when clicked, will launch a new window (using javascript's window.open() method) to a page that is located at z.com. The popup does a few things, then redirects the original window (the opener, x.com) to a different page based on some parameters defined in the popup. This works fine in Firefox/Chrome, but not in IE. In IE (8 specifically, but I believe 7 also has this problem) the original window (the opener) is not redirected.

extjs 4.0 inconsistent window.open() behavior when called within Ext.Ajax.request() [duplicate]

核能气质少年 提交于 2019-12-08 10:08:48
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: window.open(url) different behavior - same code, different timing I'll let my code snippet explain the issue I'm seeing. function myFunction() { window.open('http://www.yahoo.com'); // --> this opens a new tab on my browser Ext.Ajax.request({ url: 'PHP function call', success: function(response) { window.open('http://www.yahoo.com'); // --> this opens a new window, not tab } }); } This is very strange. From