SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: JavaScript pop up window help
-
Feb 5, 2001, 22:00 #1
How can I edit this code so that the link comes up in a new window?
code:
function open_window(url) {
var NEW_WIN = null;
NEW_WIN = window.open ("","RecordViewer","toolbar=no,width="+<?php echo $new_window_width ?>+",height="+<?php echo $new_window_height ?>+",directories=no,status=no,scrollbars=yes,resize=no,menubar=no");
NEW_WIN.location.href = url;
}
Thanks,
-JRW
-
Feb 6, 2001, 17:13 #2
- Join Date
- Jul 1999
- Location
- SC, USA
- Posts
- 390
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hey,
I don't quite understand. That code should open a new window. Perhaps you want all new windows for all the calls to the function? If so, try:
Code:function open_window(url) { var NEW_WIN = null; NEW_WIN = window.open (url,"","toolbar=no,width=<?php echo $new_window_width ?>,height=<?php echo $new_window_height ?>,directories=no,status=no,scrollbars=yes,resize=no,menubar=no"); }
aDogModerator at www.javascriptcity.com/forums/
-
Feb 6, 2001, 19:53 #3
I don't know too much PHP and even less JavaScript. This is the function that is called that allows users to go to another site. As the code stands now.... when the user click on the link the current window loads the url meaning that they have left my site. I would like the url to load in a different window so that they aren't forced to leave my site.
Maybe this helps....
-JRW
-
Feb 13, 2001, 10:31 #4
- Join Date
- Apr 2000
- Location
- Melbourne, Australia
- Posts
- 2,571
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Any reason you're not just using the following?
<a href="..." target="_blank">...</a>Kevin Yank
CTO, sitepoint.com
I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
Baby’s got back—a hard back, that is: The Ultimate CSS Reference
-
Feb 14, 2001, 19:37 #5
Arielladog, I used your code word for word and still got the same results. I need to use function for this so that it is called when url's are taken out of a MySQL database.
Maybe if you saw what I'm talking aobut it would be easier to help. Here is a link to what will be the main page of my site (please note that it is still being worked on and closed to the public). http://xtremetuning.net/index.php
You can click on the links to the right or go through the entire database using the keywords in the middle of the page. Its really set up like Yahoo so you should know your way around.
I want a new window to be opened when the user clicks on a companys website so they don't totally leave mine!!!
Thanks guys,
-JRWLast edited by jrwap; Feb 14, 2001 at 23:38.
Bookmarks