|
Posted by Rosalie Mignon on October 7, 2004, 1:41 pm
Please log in for more thread options
Hello world,
I would like to write a link for an external web site, but I don't find any
solution to replace the target attribute or onclick attribute (with
javascript).
Is there any issues ?
I would like to know if there is a validator project for XHTML 2 ?
Thanks all.
PS: sorry for the mistakes, I'm french... so I don't speak well in
english... :s
|
|
Posted by Mark Tranchant on October 7, 2004, 12:54 pm
Please log in for more thread options
Rosalie Mignon wrote:
> I would like to write a link for an external web site, but I don't find any
> solution to replace the target attribute or onclick attribute (with
> javascript).
> Is there any issues ?
You mean you want to open a new window? Chances are your users don't,
but what you can do is get Javascript to attach an onclick event to
elements of a chosen class, which keeps your code a lot cleaner.
Use the addEventListener function:
http://www.mozilla.org/docs/dom/domref/dom_el_ref31.html
That way, people without Javascript still get the link in the current
window.
You really should leave the "open a new window" decision to the user,
though.
--
Mark.
http://tranchant.plus.com/
|
|
Posted by Rosalie Mignon on October 7, 2004, 2:11 pm
Please log in for more thread options
416520b3$0$48019$ed2e19e4@ptn-nntp-reader04.plus.net...
> You mean you want to open a new window?
Exact
> you can do is get Javascript to attach an onclick event to elements of a
> chosen class, which keeps your code a lot cleaner.
>
> Use the addEventListener function:
>
> http://www.mozilla.org/docs/dom/domref/dom_el_ref31.html
>
> That way, people without Javascript still get the link in the current
> window.
Ok I will do this method.
> You really should leave the "open a new window" decision to the user,
> though.
It's a good idea, but for some links I can't do it : for example the the
validator's image which is in my menu.
I can't add a message in my menu, it's not pretty.
|
|
Posted by Mark Tranchant on October 7, 2004, 1:21 pm
Please log in for more thread options Rosalie Mignon wrote:
>>You really should leave the "open a new window" decision to the user,
>>though.
>
> It's a good idea, but for some links I can't do it : for example the the
> validator's image which is in my menu.
> I can't add a message in my menu, it's not pretty.
You don't need a message. The user should assume a link will open in the
current window unless they ask otherwise.
--
Mark.
http://tranchant.plus.com/
|
|
Posted by Jukka K. Korpela on October 7, 2004, 1:26 pm
Please log in for more thread options
> I would like to write a link for an external web site, but I don't
> find any solution to replace the target attribute or onclick
> attribute (with javascript).
Fine.
(That is, you need to remove them, not replace them. No matter which HTML
version you use.)
Technically, onclick is part of XHTML 1.1 but needs to be written
literally as onclick, not e.g. onClick. The situation is the same in all
versions of XHTML.
> I would like to know if there is a validator project for XHTML 2 ?
None needed. XHTML 2 documents can be validated using a markup validator
as soon as someone writes a DTD for it. But XHTML 2 drafts are nowhere
near such a stage.
--
Yucca, http://www.cs.tut.fi/~jkorpela/ Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
|
| Similar Threads | Posted | | Problem with xhtml Validator at http://validator.w3.org/ | July 27, 2005, 5:06 am |
| javascript in href or onclick? | August 14, 2008, 5:26 am |
| onClick="CallMultipleFns" only invokes first function | October 8, 2007, 9:48 am |
| why doesn't W3 validator recognize my doc as XHTML? | September 15, 2005, 7:32 am |
| error(?) "302 Found" on Validator XHTML W3C | August 5, 2005, 6:19 am |
| XHTML Validator choking on something that is not in my page | August 6, 2005, 2:44 pm |
| XHTML 1.0 Validator: No attributes, elements not defined... | August 11, 2004, 3:21 am |
| XHTML validator giving an error for onMouseOver | August 5, 2005, 2:24 pm |
| XHTML Validation Error while using w3 validator service | July 13, 2007, 2:11 pm |
| W3C Validator (CSS, XHTML) for intranet websites: which options are available? | January 13, 2008, 1:15 pm |
|