Saving Javascript in JS Header

Does anyone know if there is a way to save Javascript in the JS Header when Designer’s defunct parser/validator decides it doesn’t like your JS code?

Javascript script libraries could be great… but I find that I have to simply paste huge blocks of Javascript into the JS Header of multiple forms since Designer is incapable of correctly validating code in the JS Header that is dependent on libraries (which I inserted as a resource in the JS Header).

Subject: Saving Javascript in JS Header

Why not put all of the JavaScript in the Library?

I agree with what you are saving and many times I end up testing tand/or creating the script in a third party tool before putting it in the JSHeader.

Subject: Saving Javascript in JS Header

Thanks for the suggestions - I’ll play with it some more.

My problem is this - I have some utility libraries that I like to include on various forms. The way each form makes use of the libraries will vary, so it seems like a good solution would be to store the utility libraries as Javascript Script Libraries, insert them as resources in the JS Header of each form, and type in the form-specific code in the body of the JS Header.

The problem is that the form-specific code is dependent on the libraries, so Domino chokes while trying to validate it and refuses to let me save it (thank you Lotus, for assuming you know better than me what I want to do).

Subject: RE: Saving Javascript in JS Header

Ahh, there is the beauty. Create a script library for the Form specific code to and call that in as well (call it first though)…

Subject: Saving Javascript in JS Header

If it’s for web use, you’d be better off using .js File Resources marked with MIME type text/javascript. They, at least, will be downloaded and cached separately (and since there is no parser involved, there will be no errors generated). If you expect users to interact with a script more than once, this can save you a lot of bandwidth.