Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
Created May 8, 2011 22:35
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save tlrobinson/961765 to your computer and use it in GitHub Desktop.
Save tlrobinson/961765 to your computer and use it in GitHub Desktop.
Slightly less ghetto JavaScript console bookmarklet for MobileSafari
javascript:(function(){var l,r="";while(l=prompt(r)){try{r=String(eval(l));}catch(e){r="Error: "+e}}})();
(function() {
var l, r = "";
while (l = prompt(r)) {
try {
r = String(eval(l));
} catch (e) {
r = "Error: "+e
}
}
})()
@tlrobinson
Copy link
Author

Bootstrap developed using the ghetto console so I guess it wasn't that bad :-/

@tlrobinson
Copy link
Author

For posterity:

javascript:alert(eval(prompt()))

@jacobpedd
Copy link

jacobpedd commented Dec 18, 2018

When running console.log(‘test’) on iOS it gives

Error: SyntaxError: Invalid character '\u2018'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment