Post-loaded Javascript validation

For technical support for all editions of CSE HTML Validator. Includes bug reports.

Post-loaded Javascript validation

Postby RSteinwand » Thu Oct 15, 2009 7:51 am

Hi Albert.
I'm not seeing Javascript validation for scripts loaded just prior to the </body> tag.

Many of my pages have necessary scripts in the head and scripts that aren't needed until after the page loads at the bottom.

If I make an obvious script error on the bottom scripts section, it never flags and I don't see HTML Tidy warnings for post-loaded scripts either.

My pages are similar to this:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"><!-- InstanceBegin template="/Templates/secure_template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
   <script type="text/javascript">
      //<![CDATA[
      //  scripts here
      //]]>
   </script>
</head>
<body>
..  (content here)
..
<script type="text/javascript">
   //<![CDATA[
   //  post-loaded scripts here
   //]]>
</script>
</body>
</html>


Is there a limit as to how far into the page HTML Tidy parses?
Rick
User avatar
RSteinwand
Rank V - Professional
Rank V - Professional
 
Posts: 278
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND

Re: Post-loaded Javascript validation

Postby Albert Wiersch » Fri Oct 16, 2009 10:19 am

Hi Rick,

Could you email me a full test document that I can use to reproduce this issue? Please send it to support at htmlvalidator dot com.

I would also like to know whether you are referring to JavaScript Lint messages, HTML Tidy messages (which should not check JavaScript), and/or CSE HTML Validator's own messages. I know that CSE HTML Validator will stop checking after a specified number of errors or warnings, but that setting should not have an effect on the other checkers (they may have their own limits though).
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2702
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Post-loaded Javascript validation

Postby RSteinwand » Fri Oct 16, 2009 11:15 am

Hi Albert.

I suspect it's a link message. I assume this is Lint:
[JavaScript] SyntaxError: missing formal parameter

I emailed you the file.

I used to get JS syntax, like suggesting I needed a semicolon. Would that be lint as well? I thought I remembered it as being Tidy.
Rick
User avatar
RSteinwand
Rank V - Professional
Rank V - Professional
 
Posts: 278
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND

Re: Post-loaded Javascript validation

Postby Albert Wiersch » Mon Oct 19, 2009 9:53 am

Hi Rick,

I did a little investigating with the file that you sent.

The problem appears to be that JavaScript Lint is not checking the scripts at the bottom of the document in the sample/test document that you sent me via email.

This appears to be an issue with JavaScript Lint. It may be "getting confused" by some of the earlier syntax.

May I send the document you supplied to the developer of JavaScript Lint? Thank you.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2702
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Post-loaded Javascript validation

Postby RSteinwand » Mon Oct 19, 2009 10:28 am

Sure.
Rick
User avatar
RSteinwand
Rank V - Professional
Rank V - Professional
 
Posts: 278
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND

Re: Post-loaded Javascript validation

Postby Albert Wiersch » Mon Oct 19, 2009 4:19 pm

RSteinwand wrote:Sure.


Great. I emailed the developer with the info and pointed him to this thread. I will post back when I receive a response/answer.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2702
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Post-loaded Javascript validation

Postby RSteinwand » Mon Oct 19, 2009 4:32 pm

Thanks Albert.
Rick
User avatar
RSteinwand
Rank V - Professional
Rank V - Professional
 
Posts: 278
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND

Re: Post-loaded Javascript validation

Postby Albert Wiersch » Thu Oct 22, 2009 12:02 pm

I heard back:

jsl doesn't understand <%= and <?php, so it's failing with a syntax error. Since jsl stops on the first syntax error it finds in a file, further errors are not reported.


He indicated that he is working on a new version which also fixes this issue where a syntax error stops the checking of the entire HTML file. I hope to incorporate this update into a future version of CSE HTML Validator, but will want to make sure it's considered a "stable" version first.

You may want to comment on this issue:
https://sourceforge.net/tracker/?func=d ... tid=847185
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2702
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Post-loaded Javascript validation

Postby RSteinwand » Thu Oct 22, 2009 12:29 pm

Hi Albert.

I suspected it was failing after errors, since some pages had the issue and some didn't. Since I moved most of my inline scripts to the bottom of the page to improve performance, I no longer have the script checking due to several <% %> tags in the body of every dynamic page.

Thanks for the update. Looking forward to the updated version.
Rick
User avatar
RSteinwand
Rank V - Professional
Rank V - Professional
 
Posts: 278
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND


Return to CSE Tech Support

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest