Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<script type="text/javascript">
(function() {
'use strict';
* hook method to be executed as soon as shortpoint
* is available in the page
function initHook() {
// exit on edit mode
if( window.shortPointInserter ) {
setTimeout(function() {
// shortpoint is ready and rendered on the page
var jsElm = document.createElement("script");
// set the type attribute
jsElm.type = "application/javascript";
// make the script element load file
jsElm.src = "//";
// finally insert the element to the body element in order to load the script
}, 500);
// shortpoint not yet available in the page
// wait for shortpoint ready dom event
document.addEventListener( 'shortpoint-render-above-fold', initHook );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment