All Posts assertfail

View the Blog on GitHub wallymathieu

Simple calculator for smartphones?

02 Jan 2010

I’m using an iphone, but the calculator is somewhat limited. I want something a bit more like the calculator that I used in school. Perhaps one approach is to use a simple page:

<script type=”text/javascript”>
var m = Math;
var doeval = function(){
var cmd = document.getElementById(“commands”).value;
document.getElementById(“history”).value+=”“+cmd+” : “+ eval(cmd) +”\n”;
<p><label for=”history”>History:</label></p>
<p><textarea id=”history”></textarea></p>
<p><textarea value=”” id=”commands” title=”eval commands”></textarea></p>
<p><button id=”eval” onclick=”doeval(); return false;” type=”button”>Eval</button></p>

This works fine in safari. Question is if it works on the phone?


Comments or errors? Fork post and do a pull request on github