Solved

Pop-up mini windows

Posted on 2004-04-04
14
462 Views
Last Modified: 2013-11-28
I'm building a site and I'm using some terms that I want the definitions to pop-up in miniature windows.

This is the sentence I'm working on.

You can also make it <script type="text/javascript">
function openwindow()
{
window.open("http://www.geocities.com/htmlhelp_club/scroll.html","my_new_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=350, height=250")
}
</script>
<a onclick="openwindow()">scroll</a> and <script type="text/javascript">
function openwindow()
{
window.open("http://www.geocities.com/htmlhelp_club/slide.html","my_new_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=350, height=250")
}
</script>
<a onclick="openwindow()">slide</a>.

The problem is that they both open to the "slide" definition. Help please?
0
Comment
Question by:kgpretty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
14 Comments
 
LVL 12

Accepted Solution

by:
lil_puffball earned 50 total points
ID: 10753950
You can't have 2 function with the same name. Use this function instead:
--------------------------------------------
<script type="text/javascript">
function openwindow(url)
{
window.open("http://www.geocities.com/htmlhelp_club/"+url,"my_new_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=350, height=250")
}
<a onclick="openwindow('scroll.htm')">scroll</a>
<a onclick="openwindow('slide.htm')">slide</a>
0
 
LVL 25

Expert Comment

by:devic
ID: 10754001
don't worry, if it does not work, just rename htm to html ;)
0
 
LVL 12

Expert Comment

by:lil_puffball
ID: 10754049
oops. Thanks devic for catching that, I always name my files .htm so I assumed everyone used that--DOH! x_x
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 25

Expert Comment

by:devic
ID: 10754086
hehe and i always name my files .html ;)

btw all attributes with value "no" are optional.

window.open("http://www.geocities.com/htmlhelp_club/"+url,"my_new_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=350, height=250")

equal to:
window.open("http://www.geocities.com/htmlhelp_club/"+url,"my_new_window", copyhistory=yes, width=350, height=250")
0
 
LVL 17

Expert Comment

by:mreuring
ID: 10755693
And to my knowledge spaces are not allowed in the atribute list? Plus, you forgot a quote in that last statement devic :)
window.open("http://www.geocities.com/htmlhelp_club/"+url,"my_new_window", "copyhistory=yes,width=350,height=250");
0
 
LVL 25

Expert Comment

by:devic
ID: 10755739
space is ok, but for the quote thanks ;)


space can be critical here:
<span onclick=showit(1, 2)>show2</span>
but with this no:
<span onclick="showit(1, 2)">show2</span>


<script>
function showit(a,b)
{
      alert(a+"\n"+b);
}
</script>
0
 
LVL 17

Expert Comment

by:mreuring
ID: 10755773
I didn't mean the arguments of the function but specifically the list of arguments you sent along to the opener to determine the width and height of the window. I just had to look it up and here's the reference:
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/window.html#1202731

A direct quote from that:
"windowFeatures is an optional string containing a comma-separated list of options for the new window (do not include any spaces in this list). After a window is open, you cannot use JavaScript to change the windowFeatures."

Quite likely some browsers may accept a feature list containing spaces, but it's best to keep them out, I know for a fact that netscape 4 won't render the new window properly (only accepting the first option and ignoring the rest) and it's likely not the only one...
0
 
LVL 25

Expert Comment

by:devic
ID: 10755827
ach, ns 4 :), i don't care aboute ns4 anymore.
but anyway, if without space is better, then is better ;)
0
 

Author Comment

by:kgpretty
ID: 10758437
Thankyou!
0
 
LVL 25

Expert Comment

by:devic
ID: 10761123
hi kgpretty,

btw you can read about "What's the right grade to give? "

http://experts-exchange.com/help/closing.jsp#7
0
 
LVL 12

Expert Comment

by:lil_puffball
ID: 10761140
Thank you devic. :)

kgpretty, thanks for the points. But if there's nothing wrong with my answer, A is the right grade to give. I hope you don't mind if I post a question to change the grade? :)
0
 

Author Comment

by:kgpretty
ID: 10771768
lol.. A is perfect. atleast thats what I thought. In the code you gave me, you put .htm instead of what I had. I was confused for a minute. It wasn't perect.. so I gave you a B.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Marketing can be an uncomfortable undertaking, especially if your material is technology based. Luckily, we’ve compiled some simple and (relatively) painless tips to put an end to your trepidation and start your path to success.
Online promotion is consistently becoming more important for all types of businesses. From Facebook ads to search engines to YouTube videos, there are all sorts of channels that can effectively be used to promote a business or product. But how shoul…
An overview of how to create reports in Adobe Analytics (formerly Omniture Site Catalyst) using pageNames, events, eVars and props. This video will show you how to install the Omniture Debugger tool so can see (and test) what is being passed int…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question