where to insert JS

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
User avatar
roedygr
Rank V - Professional
Rank V - Professional
Posts: 370
Joined: Fri Feb 17, 2006 5:22 am
Location: Victoria BC Canada
Contact:

where to insert JS

Post by roedygr » Wed Jan 18, 2017 12:56 am

inserting JS

You gave me this code some time ago to keep track of which files have not changed since the last validation. It has stopped working in 17. I can't find the place to insert it. What is the rabbit warren menu navigation?

// save as cache.js and include in batch target optionss user functions file
/*********************
* Set $cachefolder in onBeforeMainStart() to the folder to use to store data (it must end in a backslash)
*********************/

function onBeforeMainStart() {
$cachefolder='E:\\env\\htmlval\\cache\\';
}

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

Re: where to insert JS

Post by Albert Wiersch » Wed Jan 18, 2017 8:15 am

Hello,

Here is the documentation page for onBeforeMainStart():
https://www.htmlvalidator.com/v170/docs ... nstart.htm

It's a Batch Wizard event function so you should open the Batch Wizard, load the target list that you want to apply it to, and then specify that file as the user functions file in the 'Target List Options' tab of the Batch Wizard.

I try to maintain backward compatibility so chances are high that it should still work like it did in previous versions. If it doesn't though then I would be happy to help if you can provide detailed information on what is not working.

By the way, I don't recommend use a js extension because it's not JavaScript. I recommend a txt or cfg file extension, however the extension of TNPL user function files doesn't really matter to CSE HTML Validator.
Image
Albert Wiersch

Post Reply