Here's a function:
javascript code:
function totalCost(currency)
{
// alert(currency);
elem('total_cost').innerText = currency+' '+Math.round((cost.main+cost.pp+cost.wwpap+cost.icp)*100)/100;
setTimeout("alert(elem('total_cost').innerText)",0);
}
The setTimeout(...,0) just means execute immediately. In this form, everything works fine.
If I change it from 0 to 1 — ie: execute the alert after one millisecond — or if I simply comment out the alert, then Internet Explorer cries. with the message "Internet Explorer cannot open the Internet site {url} Operation aborted", before changing to the incredibly helpful "Cannot find server or DNS Error
" generic error page.
I can't figure out what's wrong, because all the code is perfectly fine and runs with no errors on FF (or with the alert), and I have even less of an idea why the alert prevents IE from throwing its tantrum.
Anybody have any suggestions?