I have a fairly standard jQuery get
function that calls some other functions on done()
. In modern browsers this all works well. In IE9, the object that I created at the same scope level as the get()
function gets lost:
var movieData = {};
movieData.ajaxUrl = ...;
...
// get movie data using the api
$.get(movieData.ajaxUrl, function (data) {...
movieData.cust = data.customer_id;
movieData.type = (movieData.cust == 1 ? 'al' : 'custom');
...
}, 'json').done(function (data) {...
// show the modal and load the player
$('#AlMovieModal').modal('show').on('shown.bs.modal', function (e) {
setPlayerHt(this);
if (movieData.type == 'al') {
The value of movieData
and movieData.type
are available all the way up to the modal()
function call. Once inside, those values become undefined, in IE9 only.
What am I missing regarding object/variable scope and older IE? Thanks.