Last active
August 29, 2015 14:06
-
-
Save plcstevens/fcfdbfb226b8541b4bfa to your computer and use it in GitHub Desktop.
This is how we can allow users to call ReevooMark api actions from outside of our callbacks. Please note as this is all asynchronous, ReevooMark is not guaranteed to exist. Therefore this should only be used when the call to ReevooMark occurs some time after page load.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = '//cdn.mark.reevoo.com/assets/reevoo_mark.js'; | |
var s = document.getElementById('reevoomark-loader'); | |
s.parentNode.insertBefore(script, s); | |
})(); | |
afterReevooMarkLoaded = [function() { | |
ReevooApi.load('YOUR_TRKREF', function(retailer) { | |
if (window && window.ReevooMark === undefined) { | |
window.ReevooMark = retailer; | |
} | |
retailer.init_badges(); | |
}); | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For example a client could now use the following code example elsewhere on their page.
Please note that this implementation DOES NOT SUPPORT multiple TRKREFs.