This is a discussion on "javascript to open new window" within the JavaScript Forum section. This forum, and the thread "javascript to open new window are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
javascript to open new window
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
javascript to open new window
In trying to avoid the "target" issue, I have reverted to javascript to create a new browser window for certain links on my site. I am trying to keep it working when javascript is disabled and that seems to be okay in Firefox so far. For accessibility reasons I'm including alt text "opens in new window" too.
IE on PC: alt says "opens in new window" and then it doesn't, it opens in the same window IE on PC: alt says "opens in new window" and new window opens....but no content. Firefox on PC: alt says "opens in new window" and does just that. However if I go back to the main window and click on another link to open in the new window, the new window hides behind the main window. Firefox on the mac: as above I can live with it opening in the same window, but it's confusing then as my alt text says "opens in new window". Can anyone troubleshoot my basic code below. I'm sure I'm making a fundamental error...should I start from scratch again?
Last edited by snappy; Nov 3rd, 2006 at 19:03. Reason: duplicate thread title |
|
|
|
#2
|
||||
|
||||
|
Re: javascript to open new window
Unobtrusive JavaScript is the only way to fly:
http://adactio.com/atmedia2005/ That's suited to exactly what you need. |
|
#3
|
|||
|
|||
|
Re: javascript to open new window
That sounds cool...... and.... complicated!
DOM scripting is something I planned on looking at when I covered CSS and PHP and MySQL and the secrets of the universe/meaning of life etc. I'm not afraid of learning, but be honest with me, is this worth a non-techie newbie pursuing? Or should I take the flak and keep my "target"s?? Cheers Snappy |
|
#4
|
||||
|
||||
|
Re: javascript to open new window
Everything you need is in that link I posted...
Just add that JavaScript to your page and add the class "popup" to every link you want to open in a new window. IE
|
|
#5
|
|||
|
|||
|
Re: javascript to open new window
I've done exactly as you say, but doesn't work for me. Link opens in the same window. Should I be putting something inside the <script></script> tags?
However if I go back to the main window and click on another link to open in the new window, the new window is hidden behind the main window. I have a list of 30 links that I want to open in this new window and displayed on top of the main window obviously. How can I make the pop up come to the front every time? |
![]() |
| Tags |
| javascript, accessibility, open window |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Open another new window from javascript window | thehermitage | JavaScript Forum | 10 | Jan 27th, 2008 20:42 |
| Change open in new window to open in same window | nsr500rossi | JavaScript Forum | 2 | Jan 18th, 2008 15:13 |
| [SOLVED] open new window from main window | AdRock | Other Programming Languages | 1 | Nov 1st, 2007 03:45 |
| Need JavaScript for html links should open in a new window in the first time, after.. | jayaramgussy | JavaScript Forum | 0 | Jun 19th, 2007 09:00 |
| Open a new window | pokerskatershark | JavaScript Forum | 4 | Mar 17th, 2006 20:25 |