-
Popups in Javascript
I made a javascript function that works through a link. The function uses the age old window.open method to create a popup when the link is clicked. Only one thing bugs me. When I test in on my computer it's perfect, but on the server it seems as though the status feature setting is being ignored. I tried setting status to "no" and to "0". No matter what, the status bar shows on the popup when viewing it as-is on the server. It looks fine on my computer.
What gives?
-
Re: Popups in Javascript
First, move the function from the href="" property to the onclick="" event handler. Also, you won't need javascript:window.open(...), just the window.open(...) part. The rule for all these features is that when you change one of them. Preferably, the only thing necessary other than height and width would be scroll (set to yes or no). The window should then lose its status bar.
Dr. Script
-
Re: Popups in Javascript
"First, move the function from the href="" property to the onclick="" event handler"
Since I have multiple pages that use it, I just put it in a .js file as a function and I call it in link tags using onClick when necessary.
"Also, you won't need javascript:window.open(...)"
Had that covered as well.
"Preferably, the only thing necessary other than height and width would be scroll (set to yes or no). The window should then lose its status bar."
Ok, I went ahead and simplified it a bit. The status bar is still absent when I test it on my computer, but it's there when I test it online.
-
Re: Popups in Javascript
Hmm ... OK. I assumed you were a beginner. But I was wrong in that assumption. Do you have the code online anywhere that you could link us to?
-
Re: Popups in Javascript
No need. The problem apparently isn't my code. I ran the page on 3 different computers and it all worked perfectly fine on all of them. This probably means that the problem is local to my system, or maybe specifically to my browsers. What could be throwing this off?
-
Re: Popups in Javascript
Wow ... an unsolvable problem ;) What browser are you running? If you use Firefox, I believe there is a setting that prohibits the removal of the status bar that might be activated.
-
Re: Popups in Javascript
On all three computers I tested it in IE6 and Firefox 1. I also tested it using Netscape 7.2 on my computer and it actually turned out fine. So it's only acting up when viewed through Firefox and IE on my computer. That leads me to believe it's an IE setting since I just redownloaded and installed Firefox and Firefox imports a ton of IE settings. Any ideas?
-
Re: Popups in Javascript
Its possible, but unlikely to be an IE setting. All IE has about Javascript is to enable or disable it. Contrarily, FF has advanced options regarding JS.
-
Re: Popups in Javascript
Well, considering those are the only two browsers that are retaining the status bar when I load the popup, it has to be something common between them.
Update: I just went into FF and I went to Tools > Options > Web Features > JavaScript/Advanced > and clicked "Hide status bar". It now works fine in FF but it still is fussy in IE6. Since IE6 just flat out accepts JS as it is, why would it be doing this?
-
Re: Popups in Javascript
Hmmm. I'm clueless on what IE is doing here. I never had a problem with it. However, it seems to be less of a problem since its only doing that fror you.
-
Re: Popups in Javascript
Good point. But I'm the type of person that'll stress over this kind of stuff. I really wanna know what is causing it!
-
Re: Popups in Javascript
I'm the same way when there is just the smallest of problems ;)