eBook authors eBook Software - create and publish your own ebooks
Create your own eBooks
Learn How To Create, Publish & Market E-Books
E-Book Creation Software
Add sophisticated multimedia to your E-Books
Create E-Book covers in minutes
E-Book Marketing & Promotion made easy
Search engine for E-Books
Interviews with eBook authors
Tools for building better eBooks
Archived Message:

External javascript file

ajsaw I am trying to call an external javascript file into into my e-book and can't seem to get the syntax right.

If I use <SCRIPT src="dataFile.js"></script> and include the file in the e-book I have no problems. I need the file to be separate from the e-book, although still in the same directory.

I have excluded it from the e-book compilation but as I say I can't seem to get the syntax right for calling in the external file.

Any help will be greatly appreciated.

Posted on: 5:25 am on November 11, 2002
auctioneer Have you tried putting the javascript file in a seperate directory and the using the "include" feature?

I used it for my e-book to call in common headers and footers for design purposes. There is no reason why you couldn't just enable and use it for one page.

Give it a shot!

Posted on: 11:43 pm on November 11, 2002
Alaska To build an ebook that reads in an external .js file, using the configuration you described, try the [app] variable.  It will insert the current book path in front of the filename:

< SCRIPT LANGUAGE="JavaScript" SRC="[={app}]/insert_me.js">< /script>

 ...just be sure to turn the Preprocessor on for that page.

 In this configuration, any change in the .js file will reflect in the ebook as soon as you hit 'refresh.'

Be sure to remove the spaces after each '<' symbol when cutting and pasting.  It was added here for display online.

 Hope this helps -

Posted on: 1:19 am on November 12, 2002
ajsaw Thanks Roger. That's perfect. I was sort of in the right area but wasn't getting the syntax right. Among other things I didn't have the square brackets in.


Posted on: 2:19 am on November 12, 2002

List All Archived Forums

Copyright © 2000-2018, Answers 2000 Limited.

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.

Contact Us    About and Terms Of Use    Privacy    Advertising/Endorsements Disclosures