This problem is very similar to that experienced in http://www.thescripts.com/forum/thread147783.html, but the solution there doesn't seem to apply here.
I have a function which works fine with the alert call in place below, but a delay (using another function defined elsewhere, which does work by the way) doesn't. Similarly if no delay is put in place it fails to complete the next line. It certainly appears that a value hasn't been finalised at that point, but I'm confused why a delay won't work. If I click the alert box immediately (i.e. a delay of 1-2 seconds) it works.
Any ideas?
Diarmid
I have a function which works fine with the alert call in place below, but a delay (using another function defined elsewhere, which does work by the way) doesn't. Similarly if no delay is put in place it fails to complete the next line. It certainly appears that a value hasn't been finalised at that point, but I'm confused why a delay won't work. If I click the alert box immediately (i.e. a delay of 1-2 seconds) it works.
Code:
function loadProperties() {
new Ajax.Updater('property_div', baseUrl+'/property/ajaxCorrespondenceProperties', {
method:'post', postBody:'town_id='+$F('town_id')
});
//alert("setting property selection");
//pause(5000);
townId = document.getElementById('town_id').value;
propertyId = document.getElementById('property_id').value;
}
Diarmid
Comment