window.open

Open new window after a click event not working in Safari, Chrome

冷暖自知 提交于 2019-11-28 09:15:14
I'm trying to open a new window like so: $('#wrapper').click(function() { window.setTimeout(function() { //alert('hi'); window.open("http://example.com", "ExternalLinks", "resizable=yes, scrollbars=yes, status=yes"); }, 1000); }); This works in Firefox, but not in Chrome or Safari (so far, I've just tested on a Mac). The alert() works in all browsers, so there seems to be something preventing the window.open from executing in Safari/Chrome. Furthermore, if I remove the setTimeout and just call the window.open then it does work in all 3 browsers. It's almost like if the window.open is nested

Javascript window.open not working

一笑奈何 提交于 2019-11-28 09:03:43
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.open(response,"twitter","menubar=1,resizable=1,width=350,height=500"); } } The standard popup-blocker

Override window.open()

对着背影说爱祢 提交于 2019-11-28 06:16:08
问题 I'm trying to override window.open() , so I'm trying to find a way to open link in new window without window.open() . In detail, I'm in such a situation: I've got a Silverlight Web Part Which uses HTMLWindow.Navigate() to open hyperlinks in new window, so I cannot use <a> because I've got totally no control to the Web part. The only way is to override window.open() . For example, when I want to open link in the top window, I override window.open() like this: window.open = function (open) {

window.open() add a rel=“nofollow” attribute

半腔热情 提交于 2019-11-28 01:53:24
问题 Is there a way to add a rel="nofollow" attribute to the window.open() Javascript function? Or is that any way to have Google not follow a link created by Javascript or jQuery. Update Also, this will be a product for a client and I will not have access to their files. Any changes the robot.txt or .htaccess are off the table. 回答1: Google can read javascript links In HTML5, the nofollow link type may only be used with a and area elements. Since you are already using javascript.. (and can not

How to get element and html from window.open js function with jquery

前提是你 提交于 2019-11-28 00:57:31
问题 I am trying to open a popup like this: $('#btn').click(function () { var popup = window.open('mypage.php', '_blank', 'width=500,height=500'); var dom = popup.document.body; for (i in dom) { console.log(dom[i]); } }); Now what I want to do is to get the html from the popup window and also be able to use maybe a jQuery function from the window.opener (the page that opened the popup) PS. In the console there are a lot of things printed but no html source. Use this to try: http://jsfiddle.net

popup open position in chrome

帅比萌擦擦* 提交于 2019-11-28 00:42:19
When I'm using firefox and then using window.open('blah.com','blah','left=-30,top=-300'); , the popup opens in my second display above my first one but in chrome, the popup just opens at left=0,top=0 . Is there a reason why chrome is doing this and how would I fix the problem? Thanks! I think this is a bug in Chrome to be honest but I'm not aware of a fix at the moment as I'm new to JavaScript myself. Sorry I'm sure this not the answer you were looking for. This is a bug in Chrome when the pop-up window is opened on the secondary monitor. The Chrome folks seem to say that this is a security

appendChild not working with window.open in IE

与世无争的帅哥 提交于 2019-11-27 23:03:44
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. Mirko Cianfarani IE will block appending any element created in a different window context from the window context that the

Find window previously opened by window.open

我的梦境 提交于 2019-11-27 19:25:16
We've got the following situation, running from a single domain: Page A uses window.open() to open a named window (a popup player). window.open() gives page A a reference to the window. User now reloads page A. The reference to the named window is lost. Using window.open() to "find" the window has the unfortunate side effect of reloading it (undesirable). Is there any other way to get a reference to this window? Try this: var playerUrl = 'http://my.player...'; var popupPlayer= window.open('', 'popupPlayer', 'width=150,height=100') ; if(popupPlayer.location.href == 'about:blank' ){ popupPlayer

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

烂漫一生 提交于 2019-11-27 14:27:28
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. It's the space in the second parameter that's causing it. If you use "UploadPhoto" instead of "Upload Photo", it works: $('#change

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

感情迁移 提交于 2019-11-27 14:24:30
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(400,220)[0]; var top = getDialogPos(400,220)[1]; addWindow = window.open("adicionar_email.htm",null,