W3C home > Mailing lists > Public > www-validator@w3.org > December 2008

Re: [VE][xmlwf] Anchor href problem

From: David Dorward <david@dorward.me.uk>
Date: Fri, 05 Dec 2008 11:20:18 +0000
Message-ID: <49390E72.3030705@dorward.me.uk>
To: "Jos Keuter (Dynarics)" <jos.keuter@dynarics.com>
CC: www-validator@w3.org

Jos Keuter (Dynarics) wrote:
>
> Error [xmlwf]: " XML Parsing Error: xmlParseEntityRef: no name"
> NOTE: Whenever possible, give the address of the document you were 
> checking. à Sorry, running a local project here…
>
So we don't know what Doctype you are using, what Content-Type you are 
using, or what the rest of the document looks like.


> Hi,
>
> I get the error message above when validating a page.
>
> This is the code:
>
> <a href=”javascript:myNamespace.navigateTo('/Somewhere/Home/14/');”>…</a>
I don't see an ampersand there, which is the usual cause of the error. 
Is this the right piece of code?

As an aside...

Using href="javascript:..." is not good practice.

Something along the lines of:

<a href="/Somewhere/Home/14/" 
onclick="myNamespace.navigateTo(this.href); return false;"> would be better.

... and attaching the JS event programatically (e.g. jQuery('#myMenu 
a').click(function () { myNamespace.navigateTo(this.href); return false; 
} ) would be better separation of concerns.


(Please direct follow ups to www-validator and not directly to me, thanks)

-- 
David Dorward
Received on Friday, 5 December 2008 11:20:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:33 GMT