| filsa.net: Frontier Scripting [ Script Archive | Ideas & Issues | Polyglot | Software | Projects ] |
|
|
Improving Javascript SupportFeaturing suites.jsl: A pageheader script for the <SCRIPT> tag.Originally posted 5/15/98AddText Brent put out a very useful macro for including scripts or bits of text on the Frontier-Work list. I think it's a great little macro. Since he's thinking about Javascript, I thought I'd share one script that I use for doing Javascript or VB in the #pageheader. It's part of my suites.jsl, or Javascript Library. I was going to release this suite at some point, but since it doesn't look like it will happen soon, I think there's more to gain by sharing the idea. jsl.scriptTag () Should be called from #pageheader. Takes no parameters. Backwards compatible with #javascript.
Search the table for anything that begins with #jsl_, process it, and add to the <HEAD>. This allows for flexible names-- #jsl_titleRollover or #jsl_checkFormFields. As many different scripts as you need, with no namespace problems. Processing includes following addresses to an object. I currently DON'T check up the hierarchy for named objects, but could add it very easily. Scripts (and other objects) that begin with #scriptLanguage are NOT executed. The #scriptlanguage param is used to generate <script> tags. Since scripts are coerced to a string, we get automatic semi-colons, braces and tabs where necessary--a big boon for Javascripters. We get to write Javascripts in outlines! Scripts that don't begin with #scriptLanguage are executed, so you can have intelligent script objects. You are free to use this and modify it If this provides good ideas that can be used, I'd be really happy. But I'd like to keep the jsl name. Thanks! Better yet, write me an email and BUG me about it, and maybe I'll clean the suite up to my satisfaction and publish it.
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is Phil's Frontier Scripting Site. San Francisco, CA |
| filsa.net: Frontier Scripting [ Script Archive | Ideas & Issues | Polyglot | Software | Projects ] |