Post-loaded Javascript validation

For technical support and bug reports for all editions of CSS HTML Validator, including htmlval for Linux and Mac.
Post Reply
User avatar
RSteinwand
Rank VI - Professional
Posts: 596
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Post-loaded Javascript validation

Post by RSteinwand »

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
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Post-loaded Javascript validation

Post by Albert Wiersch »

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).
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
RSteinwand
Rank VI - Professional
Posts: 596
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: Post-loaded Javascript validation

Post by RSteinwand »

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
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Post-loaded Javascript validation

Post by Albert Wiersch »

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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
RSteinwand
Rank VI - Professional
Posts: 596
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: Post-loaded Javascript validation

Post by RSteinwand »

Sure.
Rick
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Post-loaded Javascript validation

Post by Albert Wiersch »

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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
RSteinwand
Rank VI - Professional
Posts: 596
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: Post-loaded Javascript validation

Post by RSteinwand »

Thanks Albert.
Rick
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Post-loaded Javascript validation

Post by Albert Wiersch »

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 CSS 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
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
RSteinwand
Rank VI - Professional
Posts: 596
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: Post-loaded Javascript validation

Post by RSteinwand »

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
Post Reply