Results 1 to 3 of 3

Thread: function calling in java

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2002
    Location
    Mesa, Arizona
    Posts
    45

    function calling in java

    Is there a way to call a function in another HTML file? Thanks.

  2. #2
    Lively Member
    Join Date
    Jul 2002
    Location
    Gateshead, UK
    Posts
    101

    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>

  3. #3
    Lively Member
    Join Date
    Jul 2002
    Location
    Gateshead, UK
    Posts
    101

    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
  •  



Click Here to Expand Forum to Full Width