IE8 Object Expected JQuery .ready function

321 Views Asked by At

I have the following function that is called in the head tag.

Page::IncludeJavascriptFile('js/packages.js');
Page::AddHeadElement('
    <script type="text/javascript">
        $(document).ready(function() {
            pollClientTable('.TriplecastConfig::get('transfer_polling_period')*1000 .', true);
        });
    </script>
');

pollClientTable is defined in packages.js which is before the function call.

pollClientTable function:

var pollClientTableTimer = null;
var pollClientTableTimerPoll = null;
function pollClientTable(poll, async) {
clearTimeout(pollClientTableTimer);
$.ajax({
    url: "ajax_requests/getClientPackages.php",
    async: async,
    timeout: poll,
    success: function(data) {
        $('#packagesForm').empty();
        $('#packagesForm').append(data);
    }
});
    pollClientTableTimerPoll = poll;
    pollClientTableTimer = setTimeout(function(){pollClientTable(poll, true);}, poll);
}

The functions work in any other browser bar IE8. Any ideas why?

0

There are 0 best solutions below