...

View Full Version : Open in new window with properties



ziguana_man
04-14-2005, 01:57 AM
Hi, I want to open a link in a new window with certain properties (like no buttons), I have the link details but think I need some Java to make it work, this is what I have: -

<a href="http://sd.htm" onclick="window.open('http://sd.htm', 'SD', 'height=700,width=1000,status=0,menubar=0,scrollbars=0,resizable=1'); return false">Sales Database</A>

Thanks in advance, if your wondering why it's so they don't use the IE forward and back buttons and use the buttons in the page other wise they don't update my DB behind the site.

Thanks :)

Basscyst
04-14-2005, 02:06 AM
Can't do it. You can ALWAYS go back. Just press <backspace> or right click and go back. Take this into consideration when designing your application. People want to go back. They are used to going back, sometimes forward too.

Basscyst

ooiyh
04-14-2005, 02:21 AM
This how I do it.



function openBrWindow(theURL,winName,features)
{
window.open(theURL,winName,features);
}

<a href="javascript:;"
onClick="openBrWindow('webpage/index.html','test','status=yes,scrollbars=yes,resizable=yes,width=400,height=300')">
Click Here</a>

ziguana_man
04-14-2005, 04:54 AM
I got two errors, one loading the page was

line 9 Char 2: 'Null' is Null or not an argument

and the second error I get when I click the link is

line 8 Char 3: Invalid argument.

4 <SCRIPT language=JavaScript>
5 function openBrWindow(theURL,winName,features)
6 {
7 window.open(theURL,winName,features);
8 }
9 }
</SCRIPT>

ooiyh
04-14-2005, 06:05 AM
4 <SCRIPT language=JavaScript>
5 function openBrWindow(theURL,winName,features)
6 {
7 window.open(theURL,winName,features);
8 }
9 } ---> I don't think this bracket should be inside
</SCRIPT>

Did you enter it accidently?

_Aerospace_Eng_
04-14-2005, 06:24 AM
rather than using javascript:; in the href tag, I would use return false instead, this way if the user has javascript disabled, they can still see your page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
function openBrWindow(theURL,winName,features)
{
window.open(theURL,winName,features);
}
-->
</script>
</head>

<body>
<a href="webpage/index.html"
onclick="openBrWindow('webpage/index.html','test','status=0,scrollbars=1,resizable=1,width=400,height=300');return false" target="_blank">
Click Here</a>
</body>
</html>

ziguana_man
04-14-2005, 09:31 AM
I got two errors, one loading the page was

line 9 Char 2: 'Null' is Null or not an argument

and the second error I get when I click the link is

line 9 Char 1: invalid argument

5 <script type="text/javascript">
6 <!--
7 function openBrWindow(theURL,winName,features)
8 {
9 window.open(theURL,winName,features);
10 }
-->
</script>

glenngv
04-14-2005, 10:58 AM
For the first error, you have to show more code, the error must be in other codes. The second error invalid argument error means you're passing an invalid value for a parameter in a function. You might be passing an invalid winName value when calling openBrWindow() function. Special characters such as space, comma, etc. are not allowed (except for underscore only) in window.open targets.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum