Last active
September 30, 2015 21:58
-
-
Save RonnyO/1868485 to your computer and use it in GitHub Desktop.
Conditional loading of live.js for dev environments
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
// Load live.js on local envs only | |
// Make sure the path is right and your dev env passes the test. | |
/* Delete these characters to disable it temporarily -> */ | |
(function() { | |
if(/^https?:\/\/(localhost|127.0.0.1)|^file:\/\/\//.test(document.location.href)) { | |
var live = document.createElement('script'); | |
live.src = 'js/live.js'; | |
var s = document.getElementsByTagName('script')[0]; | |
s.parentNode.insertBefore(live, s); | |
} | |
})(); | |
/**/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment