I suspect in most applications you won't know who to text, so you only want to fill the text body, not the number. That works as you'd expect by just leaving out the number - here's what the URLs look like in that case:
sms:?body=message
For iOS same thing except with the ;
sms:;body=message
Here's an example of the code I use to set up the SMS:
var ua = navigator.userAgent.toLowerCase();
var url;
if (ua.indexOf("iphone") > -1 || ua.indexOf("ipad") > -1)
url = "sms:;body=" + encodeURIComponent("I'm at " + mapUrl + " @ " + pos.Address);
else
url = "sms:?body=" + encodeURIComponent("I'm at " + mapUrl + " @ " + pos.Address);
location.href = url;