Created
January 3, 2014 20:00
-
-
Save Ollo/8245471 to your computer and use it in GitHub Desktop.
hacky localhost check for livereload injection
This file contains 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
// check if running locally for livereload | |
var url = window.location.protocol + "//" + window.location.host + window.location.pathname; | |
// grab the reload script from grunt | |
if ( url == "http://portal.dev" ) { | |
var lr = document.createElement("script"); | |
lr.type = "text/javascript"; | |
lr.src="//localhost:35729/livereload.js"; | |
$('#global_footer').append(lr); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment