ls_dragons Posted October 3, 2007 Share Posted October 3, 2007 I am creating a small web page that MUST open links in a new WINDOW - it is a menu of sorts. The page works fine in Windows + Firefox with the target = _blank and with Firefox set to "open link in new window" Exact same setting and web page in Linux does not work - keeps opening new tabs for the target pages. Anyone have an idea for how to get this to work? Link to comment Share on other sites More sharing options...
+Dick Montage Subscriber² Posted October 3, 2007 Subscriber² Share Posted October 3, 2007 use javascript window.open ? Link to comment Share on other sites More sharing options...
samg Posted October 3, 2007 Share Posted October 3, 2007 Are you sure its not a setting in firefox on the Linux box? Mine is setup to only use 1 window, any link opens a new TAB in that window. Link to comment Share on other sites More sharing options...
ls_dragons Posted October 3, 2007 Author Share Posted October 3, 2007 perhaps javascript is the way to go - but I have no experience with that - how/where would the code go - what would it look like? Link to comment Share on other sites More sharing options...
noroom Posted October 3, 2007 Share Posted October 3, 2007 I think it should be up to the user whether it opens up in a new window or in a new tab. If you say it's a menu of sorts, then I might click more than one link, and I don't want to end up with, say, 6 new windows, all with one tab. Just something I think you should consider. Link to comment Share on other sites More sharing options...
markwolfe Veteran Posted October 3, 2007 Veteran Share Posted October 3, 2007 (edited) I have my firefox set to open in new tabs by default, so an href with a target="_blank" will open in a new tab. It is how I prefer to operate. However, I have some pages I run that I want a pop-up window with part numbers to open up when the user clicks a part in the main window. This is done through javascript's window.open that was mentioned earlier. Here is how I do it. I set up a javacript code before the body: <script LANGUAGE="javascript"> <!-- Hide from non-js browsers function PartWin(theURL) { window.open(theURL,'PartWin','toolbar=no,menubar=no,resizable=no,scrollbars=no,height=200,width=300'); PartWin.focus(); } --> </script> in my case, I had several other attributes decleared to make the window with a specific size and lack of other features like toolbars and scrollbars. Then, for a URL I want to force open in this window, I make the href call like this: <a href='java script:PartWin("parts/234-567.htm")'> (remove the space in "java script" to say "javascript" - see below comment - thanks!)And it works like a champ! Edited October 3, 2007 by markjensen Link to comment Share on other sites More sharing options...
+jamesyfx Subscriber² Posted October 3, 2007 Subscriber² Share Posted October 3, 2007 Just thought i'd mention, Neowin alters the word 'javascript' to 'java script' if it's got a colon after it, so fix that code if you use it. Just in case it doesn't work, theres an explanation. :p Link to comment Share on other sites More sharing options...
ls_dragons Posted October 4, 2007 Author Share Posted October 4, 2007 Thanks all - I managed to find some sample code - similar to that above - that got me what I needed. Link to comment Share on other sites More sharing options...
Recommended Posts