W3C Validation fails due to unencoded ampersands in URLs
3dloco - August 14, 2009 - 22:18
| Project: | Digg this |
| Version: | 6.x-2.1-rc1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | yaph |
| Status: | closed |
| Issue tags: | ampersand, digg, url, validation, w3c, w3c validation |
Jump to:
Description
When I use the Digg This button on nodes, the pages do not pass W3C validation.
The errors show up on the digg this frame and they occur because of un-encoded ampersands in URLs.
See below example of page source for a specific node.
/submit?url=http%3A%2F%2Fwww.example.com%2Fnodeurl&title=nodetitle&bodytext=nodedescription">
Thanks,
KH

#1
The content of the iframe is loaded via JavaScript and comes from digg.com.
I just tested validating a page where this module is in use and got no errors.
Which validator interprets JavaScript?
Can you send the link to the page that does not pass validation?
#2
Hello,
Thanks for your quick response. I am using the SGML parser (Firefox Add on) that tallies up all the errors including page source and all the frames.
I checked the page directly from the W3C website and it does validate! My apologies.
I will disregard the frame errors when I check my pages as this ampersand does not seem to be causing any issues.
Regards,
KH
#3
Not encoded ampersands are a common issue. Linking tu URLs that contain them will cause your site not to validate, unless you take care to encode them.
In cases where the source code comes from another site loaded via an iframe, you can't do much about it, since browsers usually prevent JavaScript code to change code that does not come from the same server.