I got this code:
function zeroPad(num, places) {
var zero = places - num.toString().length + 1;
return Array(+(zero > 0 && zero)).join("0") + num;
}
result = "String begin ...." + zeroPad(o.m,2) + "Month" + ... + "String end ....";
And on all Browsers/Systems it works fine. It shows things like:
06 Months 26 Days 09 Hours
But on the iPAD1 with iOS 4.3.2 with Safari it shows:
NaN Months NaN Days NaN Hours
(not a number)
Whats wrong with these apple products, where is the mistake?
//Edit (for DCoder):
This is the code that generates the whole line i don`t think that helps a lot.
h = '<span class="f_normal"><span class="f_bold">' + zeroPad(o.m,2) + '</span> Month' + (o.m == 1 ? '': 's')+ ' <span class="f_bold">' + zeroPad(o.d,2) + '</span> Day' + (o.d == 1 ? '': 's') + ' <span class="f_bold">' + zeroPad(o.h, 2) + '</span> Hour' + (o.h == 1 ? '': 's') + '</span>';
The real question i search is this bug only appears on iPad?!
Sounds like you need to cast your string as an integer:
http://www.javascripter.net/faq/convert2.htm