Created
October 1, 2013 22:52
-
-
Save erikakers/6786505 to your computer and use it in GitHub Desktop.
Javascript: Local Development App Debug
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
if ( location.hostname.indexOf('localhost') !== -1 ) { | |
App.debug = true; | |
var head = document.getElementsByTagName('head')[0]; | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = 'http://localhost:35729/livereload.js'; | |
head.appendChild(script); | |
} | |
window.log = function(){ | |
log.history = log.history || []; // store logs to an array for reference | |
log.history.push(arguments); | |
if ( this.console ) { | |
console.log( Array.prototype.slice.call(arguments) ); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment