window.open

center window.open on form submit

纵饮孤独 提交于 2019-12-02 09:22:50
My code looks like this: <script type="text/javascript"> function directions(sacred) { var x = screen.width / 2 - 700 / 2; var y = screen.height / 2 - 450 / 2; window.open(sacred.action, 'Directions', 'height=485,width=700,left=' + x + ',top=' + y); return false; } </script> <form action="http://maps.google.com/maps" method="get" target="Directions" onsubmit="return directions(sacred);"> I don't understand js, so take it easy on me if it looks sloppy. I can get this to work fine: <form action="http://maps.google.com/maps" method="get" target="Directions" onsubmit="Directions=window.open('about

setTimeout to window.open and close, on the same window?

試著忘記壹切 提交于 2019-12-02 06:21:06
I'm having a little difficulty opening up windows after a period of time, and then closing them after a period of time, automatically. I'm not sure why, but it seems like when I try to use setTimeout on a window.open and window.close they interfere somehow. Here is my code atm: function topLeft() { var myWindow = "image.png", "ONE", "width=300,height=310,top=100,left=100,menubar=no,toolbar=no,titlebar=no,statusbar=no"; setTimeout(function() { myWindow.window.open() }, 5000); setTimeout(function() { myWindow.close() }, 10000); function start() { openClose(); } window.onload = start; Thanks for

How to Create a Mailto Share Button that Opens a Window in which Ones Can Enter Email Address to Send to

雨燕双飞 提交于 2019-12-02 04:11:29
I've been searching all over the internet to find out how to create a mailto share button that opens up a new window in which the user can then type in the email address of his choice to send to. I've an attached a sequential set of images as operational example: What is the trick to this? Why can't I find any info on how to write such code ....absolutely nowhere on Stack Overflow either! As of right now this is the code that I have: $('.share-page-on-Email').click(function() { window.open("mailto:"+emailTo+'?cc='+emailCC+'&subject='+emailSub+'&body='+emailBody, '_self'); }); View my prototype

Open links, one after another

我的梦境 提交于 2019-12-02 02:46:23
I'm making a website where I'm opening a new window every 30 seconds. I got it to open the new windows properly, but I would like it to close the last window opened before opening the new one, so only one window is open at a time. How would I do this? Here's my code so far: <script type="text/javascript"> function open_win() { window.open("http://www.wol.com"); setTimeout(window.open('http://www.bol.com'),35000); setTimeout(window.open('http://lol.com'),70000); setTimeout(window.open('http://col.com'),105000); } </script> You can close a window opened by calling window.close on window.open's

Window to Window Communication in js by window name

删除回忆录丶 提交于 2019-12-01 23:37:21
问题 Is there anyone who can give me some thoughts on how to handle window to window communication using javascript givin that the two windows has no parent child relationship. Basically the other window is opened using window.open method. Any brilliant information is well appreciated. 回答1: assuming the following: windowHandle=window.open('path/to/document'); you can interact between both windows. You have a pointer to the window-object from the document where it was opened from using the variable

Window to Window Communication in js by window name

淺唱寂寞╮ 提交于 2019-12-01 20:55:11
Is there anyone who can give me some thoughts on how to handle window to window communication using javascript givin that the two windows has no parent child relationship. Basically the other window is opened using window.open method. Any brilliant information is well appreciated. assuming the following: windowHandle=window.open('path/to/document'); you can interact between both windows. You have a pointer to the window-object from the document where it was opened from using the variable-name: //doSomething has to be known inside the new window windowHandle.doSomething(); and from the document

window.open() in an iPad on load of a frame does not work

纵然是瞬间 提交于 2019-12-01 20:53:29
问题 I am trying to modify a site that uses "Morten's JavaScript Tree Menu" to display PDFs in a frames set using the Adobe Reader plug-in. On the iPad the frame is useless, so I want to open the PDF in a new tab. Not wanting to mess with the tree menu I thought I could use JavaScript in the web page being opened in the viewer frame to open a new tab with the PDF. I am using window.open() in $(document).ready(function() to open the pdf in the new tab. The problem is that window.open() does not

window.open() in an iPad on load of a frame does not work

心已入冬 提交于 2019-12-01 20:52:15
I am trying to modify a site that uses "Morten's JavaScript Tree Menu" to display PDFs in a frames set using the Adobe Reader plug-in. On the iPad the frame is useless, so I want to open the PDF in a new tab. Not wanting to mess with the tree menu I thought I could use JavaScript in the web page being opened in the viewer frame to open a new tab with the PDF. I am using window.open() in $(document).ready(function() to open the pdf in the new tab. The problem is that window.open() does not want to work in the iPad. The body of the HTML normally looks like this... <body> <object data=

Window.open only if the window is not open

℡╲_俬逩灬. 提交于 2019-12-01 16:39:41
I have a link on my site that opens a new window to a page that plays a very long audio file. My current script works fine to open the page and not refresh if the link is clicked multiple times. However, when I have moved to a seperate page on my site and click this link again, it reloads. I am aware that when the parent element changes, I will lose my variable and thus I will need to open the window, overiding the existing content. I am trying to find a solution around that. I would prefer not to use a cookie to achieve this, but I will if required. My script is as follows: function

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

∥☆過路亽.° 提交于 2019-12-01 15:40:03
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? 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> Here is my solution, please check this out: var myWindow = window.open('<myfile>.pdf','my window','resizable,scrollbars'); myWindow.document.write('<title>My PDF File Title</title>'); Hope I could