window.open

window.opener is null after redirect

白昼怎懂夜的黑 提交于 2019-11-27 01:51:53
I am opening a paypal window from the parent with window.open() . After payment and redirecting back to my page (in the popup window), I would like to close the popup and update the parent window URL. I found out this works over window.opener.location. However the console shows window.opener.location is null after redirection because as the child window changes, the popup looses the information about the opener. Well great. Now is there any way to get around this? Maybe adding a sort of "listener" to the parent who listens to the URL of the child? window.opener is removed whenever you navigate

Print function in Chrome no longer working

心不动则不痛 提交于 2019-11-26 23:24:06
问题 Our website has a feature whereby a member profile can be printed. The way that it works is that a javascript function is attached to a button via an onsubmit. The javascript function uses a window.open to reopen the page in a special mode, which redisplays a printer-friendly version of the page. This functionality has been in place since about 2008, and works in all browsers. Except about a week or so ago it has stopped working in Chrome. With Chrome, what happens is that the opened window

How to get the references of all already opened child windows

霸气de小男生 提交于 2019-11-26 22:14:21
I want to get the references of all already opened child windows. is there any way? I am not using child = window.open(....) just using window.open(....) and opening multiple child windows. If you don't want to change your current code, you can simply override window.open() function: var openedWindows = []; window._open = window.open; // saving original function window.open = function(url,name,params){ openedWindows.push(window._open(url,name,params)); // you can store names also... } Run this code before calling window.open() . All the references to the opened windows will be stored in

appendChild not working with window.open in IE

若如初见. 提交于 2019-11-26 21:18:05
问题 I have a page with an svg tag. The page has a button called "Preview" which on clicking should open a new window with the image (svg). Below is a piece of code which works in Chrome/Firefox but not in IE (I'm using IE 9- IE9 standards mode) var w = window.open(); var svg = $('#chart'); var svgPrint = svg.cloneNode(true); svgPrint.setAttribute('xmlns','http://www.w3.org/2000/svg'); w.document.body.appendChild(svgPrint); Any suggestions would be highly appreciated. Thanks. 回答1: IE will block

Why is window.showModalDialog deprecated? What to use instead?

£可爱£侵袭症+ 提交于 2019-11-26 18:58:01
I was developing a GreaseMonkey script which used window.showModalDialog . But before finishing it, I have discovered that Firefox 29 warns: Use of window.showModalDialog() is deprecated. Use window.open() instead. For more help https://developer.mozilla.org/en-US/docs/Web/API/Window.open But the problem is that window.open needs UniversalBrowserWrite privilege in order to open a modal window using window.open . Then, why is window.showModalDialog deprecated? Is there any API which doesn't require privileges? Note : I don't want a fake modal dialog (like jQuery's one), I need a real modal

Javascript “window.open” code won't work in Internet Explorer 7 or 8

别说谁变了你拦得住时间么 提交于 2019-11-26 16:46:14
问题 I am using this chunk of jQuery/Javascript code on my site to open a popup window: $('#change_photo_link').click(function(){ $id = $('#id').attr('value'); window.open("photo.upload.php?id=" + $id,"Upload Photo", "menubar=no,width=430,height=100,toolbar=no"); }); This code works on Firefox and Chrome. It does not work on IE7 or IE8 (haven't tested IE6). IE pops up an error on the line window.open . Why? The error that IE gives is "Invalid Argument" and that's all. 回答1: It's the space in the

Javascript,calling child window function from opener doesn't work

爷,独闯天下 提交于 2019-11-26 16:44:21
问题 I'm developing a web application that opens a popup using windows.open(..). I need to call a function on the opened window using the handle returned by "window.open", but I'm always getting the error message "addWindow.getMaskElements is not a function", as if it couldn't access the function declared on child window. This is the behavior in both IE and FF. My code looks like this: function AddEmail(target,category) { if(addWindow == null) { currentCategory = category; var left = getDialogPos

Javascript window.open not working

泄露秘密 提交于 2019-11-26 16:35:39
问题 Ok. I'm trying to login to twitter. The window is not opening in this code. The response that gets alerted is not null and is a link to a login screen. Any ideas? var url = "./twitter_login.php"; var con = createPHPRequest(); con.open("POST",url,true); con.setRequestHeader("Content-type","application/x-www-form-urlencoded"); con.send(""); var response = ""; con.onreadystatechange = function() { if(con.readyState==4 && con.status==200) { response = con.responseText; alert(response); window

window.open behaviour in chrome tabs/windows

不问归期 提交于 2019-11-26 14:46:22
问题 I have a small bit of javascript intended to open two or more tabs. This works fine in FF and IE, but chrome opens the second one in a new window instead of tab. It isn't dependant on the url as I've tried it with two identical url's. First opens in tab, second one in new window. Here's my code snippet: for(var i=0 ; i<sites.length ;i++) { window.open(sites[i].Url); } 回答1: Chrome automatically opens a URL in a new tab only if it's user generated action, limited to one tab per user action. In

Window.Open POST

佐手、 提交于 2019-11-26 14:34:37
问题 I have a link which when clicked I open a window with window.open like below. window.open("edit.jsp?clientId=" + clientId + "&eventId=" + eventId , 'height=600,width=800,scrollbars=1,location:no,menubar:no,resizable=1,status:no,toolbar:no'); I dont want the parameter to pass here instead I want to something like post so people cant copy url . 回答1: You cannot trigger a javascript popup and then force a post request. Three options: Trigger a POST form with target="_blank" using javascript (but