Quick and dirty way of testing Javascript live on a website in browsers without Firebug:
<form onsubmit="try {
$('output').innerHTML = $F('input') + ' => ' + eval($F('input'));
} catch (e) {
alert(e)
}
return false">
<div id="output"></div>
<input id="input" name="input" value="" on="" />
</form>
Requires Prototype, but could probably be rewritten as pure Javascript pretty easily. Could also be turned into a bookmarklet, I guess.
Without prototype.js would be something like:
var output = document.getElementById('output'); var input = document.getElementById('input'); output.innerHTML = input.value + ' => ' + eval(input.value);Btw. if you are using prototype.js, you should probably be using the Element#update(value) method instead of using innerHTML
var input = $('input');
$('output').update(input.value + '=> ' + eval(input.value));