SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript validation errors in Sidebar

    I obtained an author's widget from: ezinearticles.com, bukisa.com, hubpages.com each.
    They are all in Javascript.

    When placed in Sidebars, the W3C validator raises a hundred errors. However, when placed in a Page, it works flawlessly.

    Till date no one has given any reason why it happens. Whether anyone can help me out?
    The widget code is like this:
    <script type="text/javascript" src="http://ezinearticles.com/widget/inc/eawidget.js"></script><script type="text/javascript" src="http://ezinearticles.com/widget/widgetfetch.php?theme=100&cheader=bb2020&cborder=d0d0d0&cbackground=f1f1f1&ctopic=f1f1f1&ctopictext=000000&ch3=bb2020&cfooter=f1f1f1&cfootertext=000000&mem=805036&height=400&width=270&articles=10&authorid=My Name&bio=1"></script>
    Thanks

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Can you please provide us with a link to a test page on which the many errors occur?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply. I am so happy some one responded. Here is the link:

    [Invalid] Markup Validation of http://www.accidentinsuranceforfree.com/ - W3C Markup Validator

    I have pasted the widget in the Sidebar where it produces 28 errors. Currently I have pasted ONLY from ezinearticles.com, and not from Bukisa & hubpages.

    Thanks

    Milind

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by coolygreen View Post
    I have pasted the widget in the Sidebar where it produces 28 errors. Currently I have pasted ONLY from ezinearticles.com, and not from Bukisa & hubpages.
    I will copy here what the validator says for that first error.


    Line 144, Column 293: cannot generate system identifier for general entity "cheader"
    ….com/widget/widgetfetch.php?theme=100&cheader=bb2020&cborder=d0d0d0&cbackgroun…

    An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".

    Entity references start with an ampersand (&) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&amp;" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and &aelig; are different characters.

    If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.

    Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.

    The error message seems to be pretty clear about what the problem is, why it occurred, and what you can do to fix the problem.

    Is there anything about it though that you want further information on?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you Sir. It has worked.

    I wonder since Sidebar is just an extension, the "&amp;" rule is checked here and not on any "page".

    I have lost count on the number of forums I posted, NO ONE replied. You are a different class apart.

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by coolygreen View Post
    I wonder since Sidebar is just an extension, the "&amp;" rule is checked here and not on any "page".
    You may need to help us understand the difference between what you mean there. Can you come up with a couple of quick examples that help to demonstrate the difference between the two?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  7. #7
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sir

    As I mentioned in my first post, the same code worked without any validation errors (On a Page). I wrote this to some known thesis theme tutorial websites, and even they were amused, "when it works on a Page, why not in Sidebar"?

    I am a newbie, with just 4 months on Wordpress. I only have right to be amazed as well. I have neither any answers nor solutions.

    Moreover, as I said no one from the countless forums I posted on, replied. Again I am amazed.

  8. #8
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by coolygreen View Post
    Sir

    As I mentioned in my first post, the same code worked without any validation errors (On a Page). I wrote this to some known thesis theme tutorial websites, and even they were amused, "when it works on a Page, why not in Sidebar"?

    I am a newbie, with just 4 months on Wordpress. I only have right to be amazed as well. I have neither any answers nor solutions.
    This is the first that you've mentioned that Wordpress is involved, so there's your answer. When you put it in the wordpress page, instead of the sidebar, you should see that page source for that link has been properly converted for the page content. The good people in our wordpress forum really are the best to talk to though when it comes to Wordpress related issues.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  9. #9
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sir
    What you say must be right (Though I did not understand, it went above my head)

    When Wordpress forums kept quiet, I went to Thesis forums, then I looked for Javascript forums. If no reply resulted I would have asked sitepoint admin, where to go for it.

    (The HTML rules [not all] are so stupid and confusing, I do not venture exploring more. The code was Javascript and I thought of posting right to that specific forum)

  10. #10
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    (The HTML rules [not all] are so stupid and confusing, I do not venture exploring more. The code was Javascript and I thought of posting right to that specific forum)
    You thought the issue was Javascript, so you posted here. That's fine.

    What Paul means is, now that you know Wordpress is involved with your (lack of) errors, if you have further questions about how Wordpress deals with special characters like &'s or how it deals with Javascript, we also have a special forum section for that too :)

  11. #11
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by coolygreen View Post
    (The HTML rules [not all] are so stupid and confusing, I do not venture exploring more. The code was Javascript and I thought of posting right to that specific forum)
    To clear things up, it wasn't javascript code at all that was involved. It was instead an HTML tag that requests script content. None of the script content was involved in the problem that you faced. The same problem would have occurred if it was an image tag, or a link tag.

    The actual cause was due to how the URI in the HTML attribute was being parsed. Still, it's good that you're all sorted now.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •