SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Combining JS functions sitewide into ext js file

    Gudday all
    I have reached the stage on my site where i would like to combine if possible all my js functions into a single js file and call the functions as appropriate.
    With a little more work (! ) I can convert functions with very similar jobs to a common format and then I will be ready.
    My problem is how to reference these various functions within the ext js?
    Usually I put each function into it's own js i.e.
    Code:
    <script type="text/javascript" src="js/navigation.js">
    </script>
    but what I would like to do if possible is to reference internally these disparate functions within the single js file
    Code:
    <script type="text/javascript" src="js/navigation.js/function1">
    </script> 
    .....
    <script type="text/javascript" src="js/navigation.js/function2">
    </script>
    Is this possible and how would it be done? I would need to pass the various parameters in a swell.
    Or am I stuck with each function in it's own js file?
    ========================
    Carn the Tiges!
    www.petalsandpatches.com

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't see the reason for needing to do this. You should either combine everything into one file and call it completely. Or try to separate it into individual files (not per function, but per groups of relevant functions.)


  3. #3
    SitePoint Zealot
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for that gRoberts.
    I hadn't thought of combining them all and calling the complete file. I'll give it a try.
    ========================
    Carn the Tiges!
    www.petalsandpatches.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •