I need to call a function on page load. Typically this would be handled with a body onload call, however I’m in a CMS that reuses the body tag on multiple pages. I only need the script to run on a single page. Is there a next-best-location to initiate an onload function?
Share
You can instantiate it in a separate js file, so it will only be called when that file is loaded, not the CMS template. i.e.