Problem with script in Internet Explorer 8
hi, i have a problem with my tiny jquery script that interacts with jw media player. on initial load of my page it adds functionality after player has been embedded. i add this functionality with this code:
-
jQuery('document').ready(function() {
-
// find the embedded player
- ...
-
// add javascript functionality to the external player control
-
setTimeout( function() {
-
jQuery('#playlist li').click(function() {
- player.sendEvent('ITEM', Number(jQuery(this).attr('id')));
-
});
-
}, 250);
- }
On my site i have 2 buttons to switch between 2 player instances. I request the embed code using AJAX and re-add the above code after successfully inserted the response.
-
-
jQuery('#ajax-content').fadeOut(100, function() {
-
// find the embedded player
- ...
- // show the requested html
-
jQuery('#ajax-content').empty().html(msg).fadeIn(100).removeClass('hidden');
- // re-add javascript functionality to the external player control
-
setTimeout( function() {
-
jQuery('#playlist li').click(function() {
- player.sendEvent('ITEM', Number(jQuery(this).attr('id')));
-
});
-
}, 250);
-
}
-
}
For any reason Internet Explorer 8 does not handle the 2nd code. It claims:
The object does not support this property or method.
and references this line:
-
player.sendEvent('ITEM', Number(jQuery(this).attr('id')));
But if i alert the player object's id to check if it is know then it is there. all other browsers (opera 10, ff 3.6, safari 4, chrome) work properly.
Does anybody have an advise for me?
regards, clubnite