Hi Sunil, It's my first post on this board and I'd like to thanks you a lot for your powerful-but-tiny-web-packaging-swiss-knife ! Here is my question: How to include .js (JavaScript) files in the PreProcessor list ? I used to heavy program my html pages and I want to insert some Activ vars in my declarations files, wich are .js files. A quick look at the Activ E-Book temp dir told me that you preprocess pages than run IE Core on it (I guess..), so we are talking about text file parsing. Since .js files are text files, I think it's just a mistake that limits parsing to some kind of files (.html, .htm, others ?) How to hack this ?
Thanks you giving some times to answer me.
Sincerely, Pascal
Posted on: 5:12 pm on March 23, 2001
EBookCompiler
Hello Pascal and welcome
I think it is a compiler limitation that the preprocessor flag can't be set on .js files. I think we can look into this for future versions....
Here is the best instant work-rounds that I've come up with so far:
In the HTML file, with preprocess enabled, set up the values of your variables/constants, in SCRIPT tag which is embedded into the HTML source. Under this using CRIPT with the SRC= tag, call the .js file, which itself doesn't contain any preprocessor variables.
OR
This may or may not work, and is a cheat... but you can try it. Try renaming the .js file into a .html. You need to change SRC= to point to the new file name. Then enable the preprocessor on this "HTML" file. Be sure to turn off the Searchable and Contents attributes on this pseudo "HTML" file
Posted on: 11:06 pm on March 23, 2001
Pascal
Thanks You ! I'd used the second tricks (renaming .js to .html) and it works ! (on IE 5.0, I didn't try it on IE 4) I prefer this solution because some others files also use these vars and I don't want to re-type them in each document (error source, long to update, I'm a lazy guy ;o))
To be fully compliant with HTML's Tags syntax, I'd also added the following tag: TYPE="text/javascript". So, for others readers, a line like: <LANGUAGE="JavaScript" TYPE="text/javascript" SRC="your_js_file.html"></script> inserted in the HEAD of an html document can be PreProcessor enabled !
With any business, it is up to the individual owner of said business to ensure the success of the business. You may make more or less than any sample figures or results that might be quoted on our web sites or other publications. All business involves risk, and many businesses do not succeed. Further, Answers 2000 Limited does NOT represent that any particular individual or business is typical, or that any results or experiences achieved by any particular individual/business is necessarily typical.
Disclosure:
Our company's websites' content (including this website's content) includes advertisements for
our own company's websites, products, and services,
and for other organization's websites, products, and services.
In the case of links to other organization's websites,
our company may receive a payment, (1) if you purchase products or services,
or (2) if you sign-up for third party offers, after following links from this website.
Unless specifically otherwise stated, information about other organization's products and services,
is based on information provided by that organization,
the product/service vendor, and/or publicly available information - and should
not be taken to mean that we have used the product/service in question.
Additionally, our company's websites contain some adverts which we are paid
to display, but whose content is not selected by us, such as Google AdSense ads. For more
detailed information, please see Advertising/Endorsements Disclosures
Our sites use cookies, some of which may already be set on your computer. Use of our site
constitutes consent for this. For details, please see Privacy.
Click privacy for information about our company's privacy, data collection and data retention policies, and your rights.