Skip to main content

Figured out how to call a js (inline) snippet from HTML in a template component:


<script> var loadMoreFunc = skuid.snippet.getSnippet('loadMore'); </script> <center><a href="javascript:loadMoreFunc();">Load More...</a></center>

My question is whether or not there is a more straight-forward way to do this?

This just seems unnecessary.

Any help is appreciated.

We’d reccomend a custom component,  or a custom renderer on one of our fields,  or a snippet bound to a regular skuid button. 



Cool, thanks Zach. Tried getSnippet(‘loadMore’) which didn’t work, and I couldn’t find documentation on get. Thanks!


Okay Mark my previous post actually didn’t work. get() and getSnippet() do the same thing, one’s just a shortcut for the other. The thing that was missing is that calling getSnippet() returns you a function. You have to actually invoke the function with () in order for it to do something. I get tripped up by that on occasion as well. So here’s the correct version:


Load More...

Awesome, thanks for the follow-up. I would have found that eventually, so thanks for saving me a minute. 🙂