Forum Discussion
ChuckGrigsby
7 years agoQrew Cadet
First I wouldn't use the $.get inside console.log. I'd be willing to give you a hand if you're willing to do this in a .js custom page instead of a formula text .and then adding an invisible field to load the JS file known as the image onload technique. It's a pretty simple setup and can be found on the forum. If you add IOL and want help feel free to reach out. Chuck@Chuck.Support
- JacobJacob7 years agoQrew CadetGreat. The only reason I used console.log was to see what it looked like but that was as far as I got. It sounds like I will absolutely need a code page. I am pretty sure I have the resources to make the code page.
My question is why use IOL can't I just use an a href tag and link to said code page? Love the IOL technique, we use it all over the place, just trying to understand it better.
Thanks! - ChuckGrigsby7 years agoQrew CadetI'll let Dan answer since it's his technique but that's essentially what you're doing. You're creating an img field with that file as the source. His technique for using the global variables just make it easier to scale if you add more code pages later. So instead of having to copy all the img html code each time you just have [iol]& "yourcode.js" & [/iol]. Less is best in coding
- _anomDiebolt_7 years agoQrew EliteIn this particular use case you could forgo using the IOL technique and just call $.getScript() through one of these mechanisms when the link was clicked by the user:
<a href=javascript:$.getScript(...)>Click Me</a>
<a onclick=$.getScript(...)>Click Me</a>
Using the IOL technique is essential when you want to immediately call the script in your code page rather than wait for some user interactions such as clicking on a link.
But the point in favor of always using IOL is why craft a bunch of different solutions over the lifetime of you applicatioin when you can simply set up IOL once and uniformly invoke it through the standard method whenever needed:
[iol] & "moduleTable.js" & [/iol]
Why litter your brain remembering a dozen different partial solutions?