Click to See Complete Forum and Search --> : Need help with a popup
Viper
08-08-2003, 12:25 PM
I'm not a programmer, but my boss ask me to do a javascript, it have to open a popup window when the user change the address on the address bar or when the user close the window doesn't matter if the user hit Alt+F4 or click the X for close the window, the problem is if I refresh the page the popup show, and I don't need to show it when I do a refresh just in the change of the address or when the window close, Can somebody help me?:confused:
My name is Juan thank you.:D
FlyByProgrammer
08-08-2003, 12:50 PM
I haven't programmed javascript very long, but I'm familiar with other programming languages. The best I can do is set you in the write direction.
I believe there are built in functions involving refresh for javascript (check out http://www.w3schools.com/js/js_examples.asp for window manipulation). This code below will automatically refresh a window using the .reload method. If you write a function that turns off the popup during a refresh, it will solve your problem. I recommend working with the script below. Use the same refresh() function and a simple if statement. If you don't know how to manipulate the following script, use the earlier web address and take the javascript tutorial (it's an easy 20 minutes).
sample code
<script type="text/javascript">
function refresh()
{
location.reload()
}
</script>
My pseudo-code
<script type="text/javascript">
function refresh()
{
if the location refreshes then
popup equals false
}
</script>
A more advanced javascript programmer could give you better code. Anyone is welcome to correct me. Hope this helped a little
Viper
08-08-2003, 02:07 PM
Thank you I'm gona try this I'll let you know whats happend
Viper
08-08-2003, 04:29 PM
Still without working but thankyou very much