I'm using JQuery to setup some comboboxes and I've wrapped the .combobox calls in the .ready function to make sure my controls are available, but on every 10th or so time loading the page, the elements used for the comboboxes are not in the DOM. What is going on and how is this possible?
My external javascript
$(document).ready(function()
{
if (document.getElementById('selMinPrice'))
{
console.log('selMinPrice exists in the DOM.');
console.log('selMinPrice value=' + document.getElementById('selMinPrice').value);
}
else
{
console.log('selMinPrice DOES NOT EXIST in the DOM!!!!!!!!!!!!!!!!!!!!!!!!!!');
}
// setup min & max price comboboxes
$(".selMinPrice").combobox();
$(".selMaxPrice").combobox();
$("#toggle").click(function ()
{
$(".selMinPrice").toggle();
$(".selMaxPrice").toggle();
});
});
I've only noticed the problem in IE for some reason, but that's not to say it doesn't exist in the other browsers.
Thoughts?