arjun98854 — 2010-11-10T04:54:18-05:00 — #1
I want two of my links to open as target="blank" but I am not sure where to give target="blank" for the below link. Could you please help me fix this. Below is the link that I am trying to give target="_blank" so that it opens in a new window.
Thanks in advance.:)
chris_upjohn — 2010-11-10T05:09:36-05:00 — #2
HTML anchor element basics http://www.w3schools.com/tags/att_a_target.asp
echo "<li><a href=\\"http://ebiz.bpc.co.in/soa\\" target=\\"_blank\\">SOA</a></li>\
guido2004 — 2010-11-10T05:11:50-05:00 — #3
There are no "php links". Links are html.
Just put the target part inside the <a> tag:
<a href=\\"http://...\\" target=\\"_blank\\">link</a>
Oops, too slow
arjun98854 — 2010-11-10T05:21:32-05:00 — #4
Thanks a lot SgtLegend and guido2004.
I just pasted the code and it works perfectly.
I am new to php. Thanks to both of you again.
chris_upjohn — 2010-11-10T06:09:48-05:00 — #5
No problem, i recommend you learn HTML before you continue with PHP as you will continue to find it difficult to understand. This is how i learn't...
siteguru — 2010-11-10T06:31:28-05:00 — #6
Sort of on topic, but not PHP ... isn't the target="_blank" attribute now deprecated in the HTML specification? Yes, I know it still works - I sometimes use it myself - but will there come a time when the browsers stop supporting it?
chris_upjohn — 2010-11-10T06:45:51-05:00 — #7
The W3C standards doesn't say its deprecated http://www.w3.org/TR/2003/WD-WCAG20-HTML-TECHS-20031209/#links_popup
spikez — 2010-11-10T06:51:05-05:00 — #8
It was deprecated years ago. here is a discussion from 2004: http://www.sitepoint.com/forums/showthread.php?threadid=198185
and there are currently a couple of (heated) discussions about it!
siteguru — 2010-11-10T08:38:28-05:00 — #9
I think in today's tabbed-browser world then a lot of the comments raised there about new windows are now moot.
But the JS alternatives to _blank are unreliable as it is a lot easier these days for people to block JS from running (either en masse or selectively). So like I said earlier, _blank may be deprecated but I do still use it sometimes.
felgall — 2010-11-10T13:44:43-05:00 — #10
In 1997 it was decided that it iis far more user friendly to allow your visitors to decide how they want pages to open. By getting rid of the target attribute when they designed HTML4 they ensured that those pages that follow the standards do not disable any of the alternatives when you right click on the link to select where to open it. With a target the page maps the "open" and "open in a new window" options to the same thing.
When this was discussed in 2004 the target attribute had already been dead for 7 years. When you use target you are writing HTML3.2 (or earlier) and making your pages harder for your visitors to use.
arjun98854 — 2010-11-10T14:59:57-05:00 — #11
Thank you SgtLegend and to all of you. I will start learning in order SgtLegend mentioned.
Again thanks to you all for spending time to resolve my question.