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.
Expand|Select|Wrap|Line Numbers
- 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