|
-
Aug 18th, 2002, 11:05 AM
#1
Thread Starter
Member
function calling in java
Is there a way to call a function in another HTML file? Thanks.
-
Aug 18th, 2002, 11:12 PM
#2
Lively Member
hmm...
I don't think you can call a function from mixed files such as HTML; but a simple solution would be to write your javascript functions into seperate, javascript only text files (usually with the extension ".js"). Then, you insert the script files into any page, using empty <script> tags with the src attribute set - like so:
<script language="javascript" src="test.js"></script>
Then, if I wanted to say, call the "example()" function from that external file, I could just use the normal method wherever I liked in the document (provided that it is after the <script> being loaded, and later on in the document.)
P.S: The tags must be empty - that means only <script src=""></script>, without any inner Javascript. (you do any other scripts seperately).
<% Session("OwNeD")=True %><html><body>Blah... <%="Now get your ass back to the twilight zone..."%></body></html>
-
Aug 18th, 2002, 11:13 PM
#3
Lively Member
oops...
...unless you mean Java applets/classes, and not Javascript?
I can't help you then...
<% Session("OwNeD")=True %><html><body>Blah... <%="Now get your ass back to the twilight zone..."%></body></html>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|