Home Analyst Portal

Custom.JS "breakouts"

Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
Loving all the great community solutions found on this site.
The one thing I am wondering is how everyone is managing them.
Meaning dropping everything into the custom.js file or xyz.
Currently I have everything in the custom.js file and its getting pretty robust. What I would really like to do is breakout each solution into its own solution.js and reference in the custom.js.
Thanks

Best Answer

Answers

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.
    Answer ✓
    Hi Brain,

    Check out my example here.

    https://community.cireson.com/discussion/1714/auto-show-history#latest

    We have a script loader function in custom.js which is then used to load in all other js files.

    Geoff
  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    Awesome worked like a charm.
  • seth_coussensseth_coussens Member Ninja IT Monkey ✭✭✭✭
    One addition I would suggest here is having a check for the current page to see if you actually want the script dynamically loaded on that page. For instance in this example you would only want this script to load on work item pages, that way you aren't dynamically loading ALL your scripts on each page that doesn't actually utilize that code.
Sign In or Register to comment.