<script language="javascript">
function popUp(string)
{
window.open(string,'detail
}
</script>
<a href="javascript: popup('http://www.yahoo.co
winningl
Main Topics
Browse All TopicsI'm trying to get a new window to popup when a user clicks a link on my webpage. The link is directed towards an ASP script that shows an image from the database. I would like this link to open in a popup window that is a certain height and width (corresponding with the heights and widths of the selected image) and without any tool bars or menus visible. If anyone knows how to do this please help me out - I'd really appreciate it.
(This is kind of similar to some of those annoying porn banners - only not.)
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
<script language="javascript">
function popUp(string)
{
window.open(string,'detail
}
</script>
<a href="javascript: popup('http://www.yahoo.co
winningl
But when you don't use JavaScript while browsing (because of them f... anoying popups), you stick to basic html...
<NOSCRIPT>
<A href="Yourlink.html" target="YourWindowName">li
</NOSCRIPT>
But sizing is not possible as you probably know.
Best thing would be to combine your options ;-)
...
<html>
<script language="javascript">
function popUp(string)
{
window.open(string,'detail
}
document.write("<a href=\"javas" + cript: popup('http://www.yahoo.co
</script>
<NOSCRIPT>
<A href="http://www.yahoo.com
</NOSCRIPT>
</html>
ps :
document.write("<a href=\"javas" + "cript: popup('http://www.yahoo.co
ok..
One more time to be absolutely correct ;-)
<html>
<script language="javascript">
function popUp(string)
{
window.open(string,'detail
}
document.write("<a href=\"javas" + "cript: popUp('http://www.yahoo.co
</script>
<NOSCRIPT>
<A href="http://www.yahoo.com
</NOSCRIPT>
</html>
Yea :-)
And another one
<a href="image1.jpg" onClick="window.open(this.
It doesn't really matter though, every script has exactly the same correct idea. :-) I suggest the first comment should tell you enough already :-)
CJ
---the "main" window----
<html>
<head>
<script language="JavaScript">
function openwin() {
if(!window.iwin || iwin.closed) {
//resizable=1 is for Netscape 4.xx compatibility
iwin = window.open("","imagewin",
} else {
window.iwin.focus();
}
}
</script>
</head>
<body>
<!-- You may use the <base target="imagewin"> tag -->
<!-- to specify the target for all links at this page -->
<a href="view.htm?image1.gif"
<a href="view.htm?image2.gif"
<!-- another links may use an another target with the "base target" tag -->
<!--<a href="another_page.htm" target="_self">click</a>--
</body>
</html>
--------------------------
----the "child" window-----
<html>
<head>
<script language="JavaScript">
function onPageLoad() {
var w = document.images[0].width;
var h = document.images[0].height;
self.resizeTo(w + 10, h + 32);
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="onPageLoad();">
<script language="JavaScript">
var img = self.location.search;
if(img.length > 0) {
img = img.substr(1, img.length - 1);
document.write('<img src="' + img + '">');
}
</script>
</body>
</html>
--------------------------
??
Ok, that he had a correct answer yes, but it's a bit rude (in my opinion) to say that the rest didn't accomplish anything - wouldn't even open a new window.
I'm not eager to answer or partisipate t0 others problems this way.
I tested my idea, and it works fine (non javascript and javascript browsers , nn >=4 and ie >=5)
As the note says below.
ok..
One more time to be absolutely correct ;-)
<html>
<script language="javascript">
function popUp(string)
{
window.open(string,'detail
}
document.write("<a href=\"javas" + "cript: popUp('http://www.yahoo.co
</script>
<NOSCRIPT>
<A href="http://www.yahoo.com
</NOSCRIPT>
</html>
Business Accounts
Answer for Membership
by: COBOLdinosaurPosted on 2002-01-23 at 07:28:24ID: 6751294
This goes in the head. Adjust the values for width, height, left and
,chrome);
urn false"> click to open</a>
top to the size and position you need:
<script language="JavaScript">
<!--
function openawindow()
{
var chrome = "width=100,"
+ "height=150,"
+ "location=0,"
+ "menubar=0,"
+ "resizable=0,"
+ "scrollbars=0,"
+ "status=0,"
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "left=450,"
+ "top=100";
window.open('url.asp',null
}
//-->
</script>
Then the link looks like this:
<a href="JavaScript:;" onClick="openawindow();ret
HTH
Cd&