Page 1 of 1

where to insert JS

Posted: Wed Jan 18, 2017 12:56 am
by roedygr
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\\';
}

Re: where to insert JS

Posted: Wed Jan 18, 2017 8:15 am
by Albert Wiersch
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.