how do i get a link to open in a...
I need to know how to open a link in a new window while keeping the original page open. Anyone have the tags?
Spirallectik wrote:
I need to know how to open a link in a new window while keeping the original page open. Anyone have the tags?
I need to know how to open a link in a new window while keeping the original page open. Anyone have the tags?
Just add this into your link:-
target="_blank"
Your link would then look like this:-
<a href="http://www.site.com" target="_blank">Site</a>
Jim
---------------------------
---------------------------
From a usability viewpoint this is frowned upon except for pdfs docs etc that are not web pages. It is confusing for people to have lots of browser windows open.
Also be aware that the Google toolbar, as one example, prevents these types of windows opening so use this code with care and only when it neccessary.
Also be aware that the Google toolbar, as one example, prevents these types of windows opening so use this code with care and only when it neccessary.
Geoffrey Kevin Joyce wrote:
From a usability viewpoint this is frowned upon except for pdfs docs etc that are not web pages. It is confusing for people to have lots of browser windows open.
Also be aware that the Google toolbar, as one example, prevents these types of windows opening so use this code with care and only when it neccessary.
From a usability viewpoint this is frowned upon except for pdfs docs etc that are not web pages. It is confusing for people to have lots of browser windows open.
Also be aware that the Google toolbar, as one example, prevents these types of windows opening so use this code with care and only when it neccessary.
That brings up the question then: "What's the alternative?"
Rhubarb wrote:
That brings up the question then: "What's the alternative?"
Geoffrey Kevin Joyce wrote:
From a usability viewpoint this is frowned upon except for pdfs docs etc that are not web pages. It is confusing for people to have lots of browser windows open.
Also be aware that the Google toolbar, as one example, prevents these types of windows opening so use this code with care and only when it neccessary.
From a usability viewpoint this is frowned upon except for pdfs docs etc that are not web pages. It is confusing for people to have lots of browser windows open.
Also be aware that the Google toolbar, as one example, prevents these types of windows opening so use this code with care and only when it neccessary.
That brings up the question then: "What's the alternative?"
There are Javascript solutions which will allow the page to validate to xhtml strict. Personally I hate js so I tend not to employ it.
Javascript altervatives would look something like this:
<a href="#" onclick="nojavascript...window.open('http://www.google.com','popwin','toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,height=200,width=200');">Click Here</a>
By setting the values (or merely excluding them from the code) for Toolbars, scrollbars, location, statusbar, menubar and resizable will allow you to let the users see these controls or not. The height and width attributes can be set to size the window itself. This is good for one link. If you need more try using a script that can be "recycled" as can be generated here:
http://javascript.internet.com/generato … indow.html
Cheers,
Simon.
<a href="#" onclick="nojavascript...window.open('http://www.google.com','popwin','toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,height=200,width=200');">Click Here</a>
By setting the values (or merely excluding them from the code) for Toolbars, scrollbars, location, statusbar, menubar and resizable will allow you to let the users see these controls or not. The height and width attributes can be set to size the window itself. This is good for one link. If you need more try using a script that can be "recycled" as can be generated here:
http://javascript.internet.com/generato … indow.html
Cheers,
Simon.
Geoffrey Kevin Joyce wrote:
From a usability viewpoint this is frowned upon except for pdfs docs etc that are not web pages. It is confusing for people to have lots of browser windows open.
From a usability viewpoint this is frowned upon except for pdfs docs etc that are not web pages. It is confusing for people to have lots of browser windows open.
I disagree, and I see this all the time. When referencing a page from another site, I find that it is fairly standard to open this in another tab or window.
Cliff is correct that it is fairly standard to open up other windows when linking to a differnt site. The practice of doing so does present issues for people who are, for example, partially sighted or have a learning difficulty. I give the following as a reference from the UN - many more exist. You may also wish to view the site of Jacob Neilson, who is acknowledged as being one of the leading experts on accessibility.
WAI Definition (Checkpoint 10.1)
Do not generate pop-ups or new windows and do not change the current window without informing the user.
Explanation
Do not create pop-ups (windows that automatically open).
Do not open links in new windows without informing the users.
Rationale
Pop-ups can be very frustrating for users and many people find them annoying. Pop-ups can also erode a user's trust in a site as it affects their control over the navigation and interaction.
Furthermore, pop-ups are known to cause problems for screen-reader users because they change the focus without warning. This means that the screen reader begins reading the content of the new window, usually without warning the user that a new window has opened. If the new window displays content from another site, the user can become very disoriented and confused.
Pop-up windows used to display an error message in a form can cause problems too. The user has to read the content of the pop-up window, navigate back to the main page, and then find the relevant position on the form again before they can fix the error.
WAI Definition (Checkpoint 10.1)
Do not generate pop-ups or new windows and do not change the current window without informing the user.
Explanation
Do not create pop-ups (windows that automatically open).
Do not open links in new windows without informing the users.
Rationale
Pop-ups can be very frustrating for users and many people find them annoying. Pop-ups can also erode a user's trust in a site as it affects their control over the navigation and interaction.
Furthermore, pop-ups are known to cause problems for screen-reader users because they change the focus without warning. This means that the screen reader begins reading the content of the new window, usually without warning the user that a new window has opened. If the new window displays content from another site, the user can become very disoriented and confused.
Pop-up windows used to display an error message in a form can cause problems too. The user has to read the content of the pop-up window, navigate back to the main page, and then find the relevant position on the form again before they can fix the error.
Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.