Skip to content

Instantly share code, notes, and snippets.

@cbrunnkvist
Last active August 29, 2015 13:56
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 cbrunnkvist/9157945 to your computer and use it in GitHub Desktop.
Save cbrunnkvist/9157945 to your computer and use it in GitHub Desktop.
Location-independent snippet for LiveReload without browser plugin
<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