Last active
August 29, 2015 13:56
-
-
Save cbrunnkvist/9157945 to your computer and use it in GitHub Desktop.
Location-independent snippet for LiveReload without browser plugin
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
<script> | |
// Use LiveReload on iOS / Safari Mobile, in case your build tool middleware does not inject a tag already. | |
// Ref: http://feedback.livereload.com/knowledgebase/articles/86232-how-do-i-use-livereload-on-iphone-ipad-android-etc | |
// This variant of the script does away with having to hardcode the hostname (and protocol): | |
$(document).ready(function(){ | |
$.getScript('//'+location.hostname+':35729/livereload.js'); | |
}); | |
</script> | |
<!-- </body> --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment