Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Pop-up mini windows

Posted on 2004-04-04
14
Medium Priority
?
465 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 150 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Independent Software Vendors: 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

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Choosing a core focus or particular set of features and options can be tough. To help out, we’re going to highlight a handful of things your business needs on one of your social media pages. In other words, if one of these is missing, you should imp…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

722 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