Created
May 14, 2012 23:57
-
-
Save sagevann/2698174 to your computer and use it in GitHub Desktop.
Hark chartbeat
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
<% if HARK_CONFIG.enable_chartbeat %> | |
<script type="text/javascript"> | |
var _sf_async_config={uid:<%= HARK_CONFIG.chartbeat_uid %>, domain:<%= HARK_CONFIG.chartbeat_domain.inspect.html_safe %>}; | |
(function(){ | |
function loadChartbeat(){ | |
window._sf_endpt = (new Date()).getTime(); | |
var e = document.createElement('script'); | |
e.setAttribute('language', 'javascript'); | |
e.setAttribute('type', 'text/javascript'); | |
e.setAttribute('src', | |
(("https:" == document.location.protocol) ? "https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/" : "http://static.chartbeat.com/") + "js/chartbeat.js"); | |
document.body.appendChild(e); | |
} | |
var oldonload = window.onload; | |
window.onload = (typeof window.onload != 'function') ? | |
loadChartbeat : function() { oldonload(); loadChartbeat(); }; | |
})(); | |
</script> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment