Skip to content

Instantly share code, notes, and snippets.

@ilyakatz
Created July 12, 2012 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilyakatz/3101214 to your computer and use it in GitHub Desktop.
Save ilyakatz/3101214 to your computer and use it in GitHub Desktop.
Safe mouseflow script inclusion
(function () {
var msf_script = document.createElement('script');
msf_script.type = 'text/javascript';
msf_script.src =
('https:' == document.location.protocol ? 'https://' : 'http://') +
'cdn.mouseflow.com/projects/ba141427-dfd0-4d3a-acbe-37df41b6c8e0.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(msf_script, s);
})();
@midu
Copy link

midu commented Jul 12, 2012

(function () {
    var msf_script = document.createElement('script');
    msf_script.type = 'text/javascript';
    msf_script.src = '//cdn.mouseflow.com/projects/ba141427-dfd0-4d3a-acbe-37df41b6c8e0.js'; // http://paulirish.com/2010/the-protocol-relative-url/ (may cause issues with ie6 though)
    var s = document.getElementsByTagName('script')[0];
    s.insertBefore(msf_script, s); // why did you insert it on the parent node?
  })();

@ilyakatz
Copy link
Author

i dont think we should worry about IE6, it doesn't even show up in the stats anymore

http://gs.statcounter.com/#browser_version-ww-monthly-201107-201206-bar

@midu
Copy link

midu commented Jul 12, 2012

well, it's more about who mouseflow is targeting. On some of our challenges we had a ton of IE6 users.

Officially we do not support ie6 at all, but technically we do make sure it is usable on ie6.

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