Reputation: 495
I have code for export PDF, it is working fine for all browsers but when I use it in IE it gives me a JS error like expected identifier
for this line $.fn.yiiGridView.export();
.
Can anyone please tell me how I can resolve this issue.
$('#export-button').on('click', function() {
$.fn.yiiGridView.export();
});
Upvotes: 0
Views: 1401
Reputation: 350147
export
is a reserved word in ES6, so use the bracket notation instead:
$('#export-button').on('click', function() {
$.fn.yiiGridView['export']();
});
If you have created that function yourself, then it is better to use a different name, like myexport
:
$.fn.yiiGridView.myexport = function () { .... };
and then:
$('#export-button').on('click', function() {
$.fn.yiiGridView.myexport();
});
Upvotes: 2