window.open

opening new windows after specifc interval of time using window.open()

浪尽此生 提交于 2019-12-01 13:47:45
问题 I am looking for javascript code which will open new tabs(windows) automatically after specific interval of time. i have few websites over here, in this code which open automatically when i press the button on the html page. I want these websites to open after specific interval. like, 1st website will open when user will press button "Open Windows", 2 nd website after 1 minute and 3 rd websites after 2 minutes. eg. <html> <head> <script type="text/javascript"> function open_win() { window

How to set the innerHTML of some element in a window opened by a JavaScript window object?

泪湿孤枕 提交于 2019-12-01 09:21:30
I have some simple JavaScript code like this: <script type="text/javascript"> function openWindow() { var mywindow = window.open("file.html"); mywindow.document.getElementById("foo").innerHTML="Hey you!!"; } </script> This function is called with an onclick event. The window opens fine, but the element's innerHTML does not change. It is a file I own, so I know I am not being blocked by any security policy, and the element with id 'foo' definitely exists. (It is a DIV). I have tried other variations of .innerHTML like .src and .value, but nothing seems to work. Does anyone have any suggestions?

How to set the innerHTML of some element in a window opened by a JavaScript window object?

你离开我真会死。 提交于 2019-12-01 06:21:59
问题 I have some simple JavaScript code like this: <script type="text/javascript"> function openWindow() { var mywindow = window.open("file.html"); mywindow.document.getElementById("foo").innerHTML="Hey you!!"; } </script> This function is called with an onclick event. The window opens fine, but the element's innerHTML does not change. It is a file I own, so I know I am not being blocked by any security policy, and the element with id 'foo' definitely exists. (It is a DIV). I have tried other

disallow window open in javascript

六月ゝ 毕业季﹏ 提交于 2019-11-30 21:58:41
How can I disable window.open() using html, javascript, jQuery...? I mean block any window open attempt, making "not-working" all existing window.open() functions. Which are the best ways to do it? (working also in case of iframes) //for iframes: $.each($('iframe'), function() { this.contentWindow.open = function (url, windowName, windowFeatures) { //iframe window.open caught! }; }); //for window: window.open = function (url, windowName, windowFeatures) { //window.open caught! }; You'd be polluting the global namespace, but you could simply override the window.open method... window.open =

Internet Explorer calling window.onbeforeunload on window.open and AJAX calls

泪湿孤枕 提交于 2019-11-30 18:43:33
Ok, I have spent a while on this problem and this is what I have gathered: If you make an AJAX call in IE7 and you have a window.onbeforeunload function specified, it calls the onbeforeunload function. If you try to open a new window with window.open WITHOUT disturbing the current window, the onbeforeunload gets called. Does anyone know how to stop this? I even tried setting a variable to TRUE and check that variable in my onbeforeunload function and it still dosent work! I just need to be able to stop the execution of that method for AJAX calls and new window calls. Another and probably

JavaScript Popup Chrome 'save as'-deactivated? Why?

亡梦爱人 提交于 2019-11-30 15:25:26
问题 I am opening an popup in Javascript with: function popup(title,w,h,site) { x = screen.availWidth/2-w/2; y = screen.availHeight/2-h/2; var date = new Date() var ticks = date.getTime(); var popupWindow = window.open( title,"popup"+ticks,'width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y+',resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,titlebar=yes,hotkeys=yes,status=yes,dependent=no,location=1'); popupWindow.document.write(site); return popupWindow; } When I right

JavaScript Popup Chrome 'save as'-deactivated? Why?

一曲冷凌霜 提交于 2019-11-30 14:30:12
I am opening an popup in Javascript with: function popup(title,w,h,site) { x = screen.availWidth/2-w/2; y = screen.availHeight/2-h/2; var date = new Date() var ticks = date.getTime(); var popupWindow = window.open( title,"popup"+ticks,'width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y+',resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,titlebar=yes,hotkeys=yes,status=yes,dependent=no,location=1'); popupWindow.document.write(site); return popupWindow; } When I right click the new window, the "save as"-dialog is deactivated in chrome. How can I enable it? What am I doing

How to disconnect JavaScript popup from opener

拜拜、爱过 提交于 2019-11-30 08:35:33
问题 I'm opening a popup from my main page with code like this: <a href="http://external.domain.tld/" onclick="window.open(this.href, '_blank', 'width=512,height=512,left=200,top=100');return false"> Open popup </a> This works fine, but my problem is that the document which is loaded in the popup window has the permission to change the location of the opener window. This even works when the document in the popup is from a different domain. It has no permission to read the location but it is

Html javascript to open new window and close current window

匆匆过客 提交于 2019-11-30 06:01:00
问题 I have a popup window and in that page I have the following code in the body. <a href="http://www.example.com" target="_blank" onClick="javascript:window.close()"><img src="...something"/></a> The purpose is to have this popup window close when a user clicks on the image link, and to open a new page and be directed to http://www.example.com . It works in IE and Chrome, but not in Firefox. The popup window closes but no new window is opened. Any ideas? 回答1: Yes, I can repro this - interesting.

Internet Explorer calling window.onbeforeunload on window.open and AJAX calls

纵然是瞬间 提交于 2019-11-30 02:56:18
问题 Ok, I have spent a while on this problem and this is what I have gathered: If you make an AJAX call in IE7 and you have a window.onbeforeunload function specified, it calls the onbeforeunload function. If you try to open a new window with window.open WITHOUT disturbing the current window, the onbeforeunload gets called. Does anyone know how to stop this? I even tried setting a variable to TRUE and check that variable in my onbeforeunload function and it still dosent work! I just need to be