I have clearly got this wrong (because it doesn’t work) but I thought the following two code blocks where functional identical, but one is working as expected, the other is not.
Working:
mfObject.questions = {}
mfObject.questions.active = "#"+$('.ui-page-active').attr('id');
Not Working:
mfObject.questions = {
active : "#"+$('.ui-page-active').attr('id');
}
You should not have a
;at the end of the property assignment.Properties assigned inside an object literal are separated by commas if there are multiple assignments, and semicolons would never appear as terminators to a property assignment (though they may be present internally if you assigned a function to a property).