Fork me on GitHub

JSLint Error Explanations

JSLint will hurt your feelings. It's time to make them better!


Currently, ADsafe does not operate on whole HTML documents. It operates on <div> fragments and .js files

When do I get this error?

JSLint (prior to version 2013-03-18) throws the "Currently, ADsafe does not operate on whole HTML documents. It operates on <div> fragments and .js files" error when the adsafe and fragment options are set to true (they're false by default) and you pass it an HTML fragment that contains an <html> tag before the opening ADsafe widget <div> tag. Here's an example:

Why do I get this error?

This error is raised because JSLint doesn't know how to continue. Since JSLint is primarily a JavaScript parser, it doesn't expect an HTML fragment by default. By passing the fragment option to JSLint it will look for a specific markup structure, and only that structure. There can be no parent elements in the fragment.

In a commit on 20th March 2013, HTML, CSS and ADsafe parsing functionality was removed from JSLint. If you rely upon this functionality, you will be unable to upgrade JSLint to a version beyond that date.


comments powered by Disqus