Solved

Pop-up mini windows

Posted on 2004-04-04
14
455 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
  • 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
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.

777 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