views:

30

answers:

1

I make an async request in a web where the response is parsed into a select field where the option gets selected when dom node are ready, it's all ok in all navigators but with internet explorer 6 things gets weirder.

I logged all events in ie with scripts of my own getting a variable null assigned, but when i do a alert with it it gets defined! and everything work ok, i tried a sleep function to give a little bit more time to the process time of the page but it didn't worked to, anyone could help me find a workaround to this strange bug?

A: 

Seems to be that here everybody is great programmer and is very cool with new trends and stuff like languages on the bleding edge, but stuff like legacy seem to be a little bit forgotten here.

Well after some hours of old school debugging i discovered that dom created comboboxes seem to preserve selected attribute but it couldnt be modified via jquery, so it has to be done with traditional javascript.

Then it comes like that :

$('select option:eq(0)')[0].removeAttribute('selected');
$('select option:eq(7)')[0].setAttribute('selected');

Hope it helps to somebody dealing with this still alive nowadays 20% market share of this ugly browser.

Thanks

markcial