Custom Search : Technical Guides Sybase Oracle UNIX Javascript

Technical Guides

Of Interest

Business Intelligence and Analytics

Oracle Training

Javascript » Methods » Coding »

Using include files


Using include files makes code maintenance much easier.
Shared libraries can be stored in central locations for multiple
applications to access. To create an include file, simple place
the function definitions in a text file, and name it with a ".js"

script directive. An example follows.

Here is the main file, test1.htm:

 <script src="test2.js">
 <input type="button" value="Test Fn" onclick="f_test1()">

Here is the include file, which contains a function:

 function f_test1()
   alert("Test1 function")

When the button is pressed, the included function is called.

Javascript : Related Topics

Javascript : Methods : Incrementing a counter within an edit field
Javascript : Methods : Animation Example
Javascript : Methods : Image Mapping Example
Javascript : Methods : Redirecting Page Access
Javascript : Methods : Loading a new page dynamically
Javascript : Methods : Complex Application with Forms
Javascript : Methods : Image Viewer with Prev and Next Buttons
Javascript : Methods : Array Processing, Frameset Writes
Javascript : Methods : Javascript: Where it fits in HTML
Javascript : Methods : Accessing the cookie file
Javascript : Methods : Pure virtual call error
Javascript : Methods : Passing variables to windows
Javascript : Methods : Executing Dynamic Code
Javascript : Methods : Single line edit: Data entry issue
Javascript : Methods : Call CGI counter
Javascript : Methods : Dynamic Objects and Names
Javascript : Methods : Setting Focus to a Control During Load

Sybase Web Site
Sybase iAnywhere Mobile Web Site
Oracle Enterprise Web Site

Get the latest Rocket99 news and tech tips via

Site Index About this Guide to Sybase, Oracle, and UNIX Contact Us Advertise on this site

Copyright © 2016 Stoltenbar Inc All Rights Reserved.