Fixed JavaScript API bug using jQuery data method.