Debugging device using alert
Well debugging device(windows mobile) based application is big pain.The only way to debug webpage is using JavaScript.Well,so far so good but putting alert inside loop is again a hurdles for developer.Here is a nice way to escape this..thanks to TUMUSKI for putting it all together,
1: function alert(message) {
2: var delay = 5000; // 5 seconds
3: if (!alert.block) {
4: message += "\n\n* Click 'OK' to dismiss this alert." +
5: "\n* Click 'Cancel' to quell runaway alerts for " +
6: (delay / 1000) + " seconds.";
7: alert.block = !confirm(message);
8: if (alert.block) {
9: setTimeout("alert.block = false;", delay);
10: }
11: }
12: }
Have a fun while coding..