Re: [VE][xmlwf] Anchor href problem

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 UTC