| | #1 |
| Merchant of Truth War Room Member Join Date: 2011
Posts: 496
Thanks: 61
Thanked 259 Times in 139 Posts
|
Heres my current code: <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><script language="JavaScript">alert('click here to continue'); window.location.href = 'myurl.com';</script></head> I am sending users to this page and a little window pops up and asks them if they wish to continue. If they hit ok they get redirected. The problem is I need to resize the window when they click ok. The window that this message pops up is stuck at a certain size. Is there a way to resize the window with an onclick script or something? For example lets say the size of the window this message pops up in is 400x400. If they hit ok I want them to be redirected and the window resized to fit their screen. If i cant resize on the redirect, Is there a way to resize when they land on this 400x400 page while hitting them with the popup message? thanks |
| |
| | #2 |
| Lookin for the $$ War Room Member Join Date: 2011 Location: USA
Posts: 148
Thanks: 0
Thanked 13 Times in 11 Posts
|
You can make the 400x400 page do something like this. Except with the right code. (I dont know it right now exactly) parent.window.location = "your uRL to continuite to.com" this.window.close() Something like that might work? |
| |
| | #3 |
| Merchant of Truth War Room Member Join Date: 2011
Posts: 496
Thanks: 61
Thanked 259 Times in 139 Posts
|
nope that code above didn't work
|
| |
| | #4 |
| Scottish Warrior War Room Member Join Date: 2010 Location: UK
Posts: 120
Thanks: 12
Thanked 20 Times in 15 Posts
|
Try this w.resizeTo(900,900); |
| |
| | #5 |
| Active Warrior Join Date: 2012 Location: United States of America
Posts: 285
Thanks: 5
Thanked 25 Times in 25 Posts
|
i hope above code will work. Check this and share your experience.
|
| |
| | #6 |
| HyperActive Warrior Join Date: 2012
Posts: 418
Thanks: 0
Thanked 19 Times in 19 Posts
|
it doesn't really work.
|
| |
| | #7 |
| VIP Warrior War Room Member Join Date: 2006 Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
|
Are you saying the Alert dialog is too small? No, you can't control its size. You need to do something custom with a form. |
| |
| | #8 |
| Warrior Member War Room Member Join Date: 2011
Posts: 11
Thanks: 1
Thanked 1 Time in 1 Post
|
What about trying something like this... 1. You're using a confirm dialogue instead of an alert dialogue because you want the yes or no buttons, otherwise with the alert dialogue you only have the ok button and it's not really giving the user much of a choice - because he/she can't do anything until they click on the OK button anyway, which makes the alert dialogue box pointless for your situation. 2. With a confirm dialogue box you are now able to run a different set of instructions when the user clicks on the NO button, which wasn't possible with the alert dialogue box. 3. window.moveTo and window.resizeTo will usually work on popup windows. and here what I am doing is positioning the window to the top left and resizing the window to it's maximum available size. 4. I have called the askToProceed() function on form load like this... onload="askToProceed();". However, you could delete that and enter the code below within your HTML body, where ever you like: <script type="text/javascript"> askToProceed(); </script> Let me know if you have any questions. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript"> function askToProceed() { response = confirm('Do you wish to proceed?'); if(response) { //if user clicked yes window.moveTo(0,0); window.resizeTo(screen.availWidth,screen.availHeig ht); window.location.href = 'http://myurl.com'; } else { //if user clicked no - Do Something Here } } </script> </head> <body onload="askToProceed();"> </body> </html> |
| |
|
| Bookmarks |
| Tags |
| resize, situation, window |
| |