Forum Moderators: open

Message Too Old, No Replies

& in URL won't validate?!?

         

Emperor

8:15 pm on Mar 10, 2005 (gmt 0)

10+ Year Member



Hi guys,

I'm using Strict.

Something like this will not validate:

<a href="http://www.somesite.com/page.php?id=666&a=777">link</a>

It says that an & must be specified as &amp even inside URLS, which is irritating.

Those parameters passed to the .php page are my affiliate ID and I'm not sure I want to change the URL they gave me.

Do you think it's alright to change it, or maybe it's not worth it. I spent a lot of time making sure my pages validate in Strict mode. Should I use Transitional instead just to be safe (I never see sites using Strict)?

If I use Strict and my page doesn't validate does that mean the browser goes into 'quirks mode'?

This sucks.

Any help would be appreciated.

encyclo

8:20 pm on Mar 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The unescaped ampersand won't validate in transitional either - but whether the page validates or not won't have any effect on the rendering mode.

You should use

&amp;
in the URL - it will work perfectly and is merely a correction not an alteration to the supplied code. Even if you leave it as it is you won't have any problems apart from one validation error.

Emperor

10:12 pm on Mar 10, 2005 (gmt 0)

10+ Year Member



Thanks man,

I just wrote a little program in C++ that will do the replace for me.

In IE6 and FireFox it's exactly the same as before but now the pages validate, and I clicked the links and there is no difference.

Now I feel safe changing them.

Take care.

kaled

9:51 am on Mar 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The browser translates &amp; into & so you won't ever break anything by making this correction.

Kaled.