New Window

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

CyBerAliEn

Thread Starter
Joined
Nov 25, 2001
Messages
1,209
Hey,

I've been messing with the following code (example)

<a href="javascript:window.open ('PAGE.HTM', 'newwindow', config='height=200,width=200, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')"> LINK TEXT</a>

(might need to view page source to see HTML code)

but when I use that code to open a new window, it opens a page that says [Object] in the main window that the link was opened from. What can I do or what am I doing wrong, so that the original page on the main page stays, and only the new page/etc is opened in the new window? Please help ASAP!

Thanks
 
Joined
Jul 26, 2001
Messages
671
I used a function to accomplish this.

First, create a javascript function to open the window. Then, call it in the onclick event of your href.

< SCRIPT LANGUAGE="JavaScript">
function openWin(){
aWindow=window.open("http://www.yahoo.com","thewindow","width=640,height=450,toolbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes");
}
< /SCRIPT>


< A HREF="#" ONCLICK="openWin();">Yahoo</A>

Good luck
 

CyBerAliEn

Thread Starter
Joined
Nov 25, 2001
Messages
1,209
Hey,

Thanks for the help. But what if I want more than just one window that opens to different files? Also, can they open images too?

Thanks
 
Joined
Jul 26, 2001
Messages
671
Sure, no problem.

For the image, just specify it's path. E.g.

aWindow=window.open("http://www.site.com/picture.gif","thewindow"," width=640, ...

To open two windows, just add another line to the function. Make sure to specify a different window name !

aWindow=window.open("http://www.yahoo.com","thewindow"," width=640, ...
aWindow=window.open("http://www.google.com","<b>otherwindow</b>"," width=640, ...
 

CyBerAliEn

Thread Starter
Joined
Nov 25, 2001
Messages
1,209
Hey,

k, thx... I'll be checking it out pretty soon to see if it works.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top