English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I tried putting the first part of the script below... so it'd be the same for another link to lead to different page. However, both links popped up the same page. The popup forms worked fine... but just ONLY SAME ONE of them popped up for both links.

No spaces, of course... and it wouldn't let me type my URL. So...


Report Broken Link





Submit Feedback

2007-03-11 15:30:17 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

To Dys*... the function worked fine... however the height isn't working. Both displayed same default height while the other both has their own width. What should I do with the height?

2007-03-11 16:42:43 · update #1

3 answers

It's strongly recommended that you don't define the same function twice..

Try something like this..


Report Broken Link

Submit Feedback


Change "brokenlink.php" and "feedback.php" to whatever pages you want them to open to, along with "uniqueid1" and "uniqueid2" (thoes are used only if you want to open a popup in the same window as another popup).

Edit: I fixed the code!

Hope this helps,
Dys.

2007-03-11 16:09:07 · answer #1 · answered by Anonymous · 1 0

The "whichit" variable, which holds the reference to the window, is what needs to be changed. Remove it and you solve your problem. Also you don't need to declare the openit( ) function twice - once is enough.

Note the differences:



Report Broken Link




Submit Feedback

2007-03-11 16:11:27 · answer #2 · answered by DNA-Groove 3 · 1 0

You really shouldn't have two JavaScript functions with identical names. Give them unique names so that the JavaScript interpreter can tell which one you're referencing.

To be honest, though, those two functions are nearly identical, except it looks like they're supposed to have different URLs embedded in them.

It would be better to have a single openit() function and have the calling code pass in the URL. Doing so will leverage reusable code and provide for easier maintenance and debugging.

2007-03-11 16:17:56 · answer #3 · answered by elness 2 · 0 0

fedest.com, questions and answers