problem with openning a new window

F

Fang

Hi, I'm using the following code to open a new window in specified size, and I
don't want it to be located at the default position. Strangely, seems only
"top" can work. Could anyone please help me out?
<script language="jscript">

/* Open window*/
var windowHandle = '';
function popOpen(url,name,attributes) {
// windowHandle = window.open(url +escape(url),name,attributes);
windowHandle =
window.open(escape(url),name,"'left=20,top=20,width=500,height=600");
}
</script>
<A
onclick="popOpen('links2.htm');"
href="javascript:void(0);">
<IMG height=20 src="images/bullet.gif" width=21 border=0>Open Links Page
</A>
 
L

Lee

Fang said:
Hi, I'm using the following code to open a new window in specified size, and I
don't want it to be located at the default position. Strangely, seems only
"top" can work. Could anyone please help me out?
<script language="jscript">

/* Open window*/
var windowHandle = '';
function popOpen(url,name,attributes) {
// windowHandle = window.open(url +escape(url),name,attributes);
windowHandle =
window.open(escape(url),name,"'left=20,top=20,width=500,height=600");
}
</script>
<A
onclick="popOpen('links2.htm');"
href="javascript:void(0);">
<IMG height=20 src="images/bullet.gif" width=21 border=0>Open Links Page
</A>

Your name parameter is undefined and you've got an extraneous
single-quote in your attributes parameter.
 
T

Thomas 'PointedEars' Lahn

Fang said:
<script language="jscript">

/* Open window*/
var windowHandle = '';

The value returned by window.open() is an object reference. Although type
conversion will be performed, you should either initialize with `null' or
don't initialize at all.
function popOpen(url,name,attributes) {
// windowHandle = window.open(url +escape(url),name,attributes); ^^^^^^^^^^^^^^^^?
windowHandle =
window.open(escape(url),name,"'left=20,top=20,width=500,height=600");
^^^^ ^ does not belong here
undefined
}
</script>
<A
onclick="popOpen('links2.htm');" ^^
href="javascript:void(0);">

<http://jibbering.com/faq/#FAQ4_24>
<IMG height=20 src="images/bullet.gif" width=21 border=0>Open Links Page

The `alt' attribute is missing. said:


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,191
Latest member
BuyKetoBeez

Latest Threads

Top