That's just cheating the validation... the idea of forcing links to open on
an external page breaks some usability/accesibility guidelines (specifically
the fact that the user should be the one deciding where he wants to opens
his links), which is why it was left out of the xhtml specification.

2009/6/20 brian <[email protected]>

>
> With jQuery, you can have outside links open in a new tab/window with this:
>
> $(function()
> {
>        $('a[href^="http"]')
>                .not('[href*=' + window.location.hostname + ']')
>                .attr('target', '_new');
> });
>
> If you'd still prefer not polluting the DOM with that, you can instead
> explicitly create a new window (with dimensions, attributes, etc.)
>
> $(function()
> {
>        $('a[href^="http"]')
>                .not('[href*=' + window.location.hostname + ']')
>                .click(function(e)
>                {
>                        // new window code here
>
>                        e.preventDefault();
>                });
> });
>
>
>
> On Sat, Jun 20, 2009 at 10:50 AM, Bankai<[email protected]> wrote:
> >
> > How can you do this in a XHTML Strict environment? Target=blank doesn
> > ´t validate.
> > >
> >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to