Skip to content

Instantly share code, notes, and snippets.

@gabewb
Created September 22, 2010 19:05
Show Gist options
  • Save gabewb/592299 to your computer and use it in GitHub Desktop.
Save gabewb/592299 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
function TutorialTab_Config(T) {
T.setWebsiteId( 30 );
}
</script>
<script type="text/javascript" src="http://alpha-cdn.tutorialtab.com/core/tutorialtab.js"></script>
<!-- BEGIN TutorialTab -->
<script type="text/javascript">
var _tutq = _tutq || [];
_tutq.push(['setAccount', 30]);
_tutq.push(['setStartTime', new Number( new Date() )]);
_tutq.push(['init']);
(function() {
var tuts = document.createElement('script'); tuts.type = 'text/javascript'; tuts.async = true;
tuts.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://cdn') + '.tutorialtab.com/engine.js';
var s = document.getElementsByTagName('script')[0];
setTimeout( function() { s.parentNode.insertBefore(tuts, s); }, 10 );
})();
</script>
@gbelote
Copy link

gbelote commented Sep 22, 2010

The second snippit, "newstuff.html" is the correct one to use.

The first is old code, added at one point prepping for doing the demo thing.

The second one does a few new, better things:

  • Is Asynchronous. This loads without slowing the page down, and if cdn/ssl.tutorialtab.com goes down it won't stall the page. (Not a big deal for us, since we control both).
  • Tracks load times. Load speed is a metric we track, making it easier in the future to improve performance.
  • Pointed to the right DNS. Does really matter right now, but we don't want alpha-cdn to be a dependency.

These points are almost moot for our own site, but it's good practice to use exactly what our customers will use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment