![]() This is a fully functioning, floating window. You can move it around the entire screen, you can close it, or you can leave it open while closing the original window. The new window is completely independent of the original window. Note: If you have pop-up blocking turned on, or JavaScript turned off, then the floating window will not be displayed! The result is a window that 200 high and 400 wide being created that is independent of the original page. In this case, the open() function is called in the onLoad method of the body tag. Listing 2 uses the windows.open() function to display a window based on the code in a file called PopIt1.html file. The code in the underlying window is shown in Listing 2.įigure 2: A window displayed using window.open() Listing 2: Using window.open() This new window can also be sized via the open() function’s parameters.įigure 2 shows as simple window that is displayed by using the open() function. The open() function can call another HTML file to open separately. ![]() ![]() Instead of using the alert(), you can call the open() function to display a window that is independent from the window that generates it. So how do you do a pop-up window that floats freely? Neither allow you to get back to the underlying window until you close the new dialog window they create. The confirm() and prompt() functions are similar to alert() in that they are tied to their underlying windows as well. Additionally, the alert dialog window can’t be moved outside of the browser area of the original window. You must close the alert before you can get back to the underlying window. As such, it is not a freely floating window. The alert() method creates a pop-up that is generally tied to the underlying window that displayed it. Figure 1 shows a simple alert box generated with the code in Listing 1.įigure 1: An Alert() box Listing 1: A simple page with an alert() The alert() method is often used in many ways such as displaying a simple message in a window when a person enters or leaves a web-page. Does this sound doable? I assume I do not actually have to have a callback function, right?Ģ) If I decide to use a popup window and user makes the request on page1.asp and has now changed to page2.asp, how would I handle that? I assume every possible page the user could navigate to in our internal app, I would have to have that callback function declared in the javascript, right? We currently have an include file called common.asp that I could it in since all our pages include that.Using the alert() JavaScript method, you are able to pop-up a small window with a simple message to a user. While the PDF is being created, I assume the user can navigate to page2.asp and do something else, correct? I was thinking that instead of using a popup window when completed, I could just email them the PDF using vbscript on the server. I use javascript to send an async call to the server to start creating the PDF (it is all vbscript with a bunch of stored procs). Now that you tell me this, I think I might want to do it another way (tell me which ones are feasible)ġ) User is on page1.asp and clicks a button to create a PDF. the user may do whatever he wants in the meantime. basicly you start a async XMLHttpRequest and say: open the window when you are ready.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |