Add the following code to the onLoad page where you want to load the js file
<template onLoad="onLoad()"></template> function onLoad(){ var script = document.createElement("script"); script.src = "https://somejavascript file url"; document.getElementsByTagName("head")[0].appendChild(script); }
it will be called when a particular page or template is loaded.
Sincerely.
source share