window.open

how to show window title using window.open()?

寵の児 提交于 2019-12-19 13:48:23
问题 I want to open a new window using: window.open('<myfile>.pdf','my window','resizable,scrollbars'); The new window opens, but I do not get the title of the window as 'my window'. What could be going wrong? 回答1: If domain is same then you can change the title of new window <script type="text/javascript"> var w = window.open('http://localhost:4885/UMS2/Default.aspx'); w.document.title = 'testing'; </script> 回答2: Here is my solution, please check this out: var myWindow = window.open('<myfile>.pdf

disallow window open in javascript

蹲街弑〆低调 提交于 2019-12-19 03:25:31
问题 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) 回答1: //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! }; 回答2:

window.open returns null and fails in inline script but works from console

我只是一个虾纸丫 提交于 2019-12-17 20:44:56
问题 I'm using Smarty template system. One of its features is posibility to output script that generates debug information for every page. Here you can see an example of generated code: <script type="text/javascript"> //<![CDATA[ setTimeout(function() { //Attempt to fix the issue with timeout var _smarty_console = window.open("about:blank","md5hash","width=680,height=600,resizable,scrollbars=yes"); console.log(_smarty_console); //Trying to log it if(_smarty_console!=null) { _smarty_console

popup open position in chrome

ぃ、小莉子 提交于 2019-12-17 16:34:12
问题 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! 回答1: 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. 回答2: This is a bug in Chrome

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

 ̄綄美尐妖づ 提交于 2019-12-17 04:33:49
问题 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

window.opener with a custom function does not work in Safari

落爺英雄遲暮 提交于 2019-12-14 03:55:17
问题 I am having an issue with Safari, specifically, not finding the window.opener function from the parent window. The function I'm calling works fine in Chrome and Firefox. Does anyone have any tips? Window 1 (Parent) Opens window 2 with the following: window.open(requestUrl, "_blank", "width=440, height=500, scrollbars"); Window 2 (Popup) After the request url page returns back, the following gets called: window.parent.opener.callBackIntegrationCompleted("testing"); window.close(); I get the

After window.open, can't print in Safari for Mac

瘦欲@ 提交于 2019-12-13 21:10:31
问题 I create a secondary browser window with Javascript code, using the window.open function, and fill it programmatically with some HTML content. It works well for all browsers that my application supports except for one: Safari on Mac. In fact, the window itself is OK but the print command is disabled. Does anybody have an idea why? I should mention that the main reason to show this window is to allow the users to print some data. I guess I could implement a "Print" button in the page but I

using window.open with window.name

天大地大妈咪最大 提交于 2019-12-13 04:51:52
问题 The browser window.open method provides a way to access open windows by name. For example, window A: window.open('','myWindowName') This will open a blank window B with window.name == 'myWindowName'. Then, window C: window.open('http://example.com', 'myWindowName') This will open example.com in window B. The problem: Rather than creating a new window with name == 'myWindowName', how can I set the name of an already opened window so that it can be accessed by other windows using window.open?

Delay after opening a new tab using window.open();?

我们两清 提交于 2019-12-13 04:32:48
问题 I am looking for javascript code which will open new tabs(windows) automatically after specific interval of time. Once first url is executed, setTimeout()/setIntervals()'s are ignored?? Please help! <html> <head> <script type="text/javascript"> function open_win() { setInterval(window.open("http://www.google.com"), 1000); setInterval(window.open("http://www.yahoo.com"), 1000); setInterval(window.open("http://www.bing.com"), 1000); } </script> </head> <body> <form> <input type=button value=

Is it possible to put focus on frame after trigger to open frame is invoked a second time (Firefox)?

倖福魔咒の 提交于 2019-12-13 02:54:02
问题 I am having an issue in firefox. My research so far is telling me that there is not really a reliable way to deal with my problem, but I am wanting to ask just in case. I have the following javascript/jquery to open a new window triggered by pressing a button on my page: alipayTransactionModalTrigger.click(function() { NIWindow=window.open("<!--ALIPAY_CONF_REDIRECT_URL-->", "NI payment"); alipayTransactionModal.dialog("open"); }); In Chrome and Firefox, this opens a new frame, and the frame