Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

there are some problem in IE 11 about character and Syntax error

$
0
0

Hi,

This code is work on Edge,chrome etc.  but it doesn't work IE11.  because of this character `

if use this ` you can write html easly. 

$('body').append(`<div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"><div class="modal-dialog" role="document" style="max-width: 480px"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title"><b><span id="confirm-title">Warning</span></b></h4></div><div class="modal-body confirm-modal-body"></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal" id="confirm-button-cancel">Cancel</button><button type="button" class="btn btn-success" id="confirm-button-ok">OK</button></div></div></div></div>`);

but you have to use this type for IE11

$('body').append('<div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> \<div class="modal-dialog" role="document" style="max-width: 480px"> \<div class="modal-content"> \<div class="modal-header"> \<button type="button" class="close" data-dismiss="modal" aria-label="Close">\<span aria-hidden="true">&times;</span> \</button> \<h4 class="modal-title"><b><span id="confirm-title">Warning</span></b></h4>  \</div>  \<div class="modal-body confirm-modal-body">  \
                              \</div>  \<div class="modal-footer">  \<button type="button" class="btn btn-default" data-dismiss="modal" id="confirm-button-cancel">Cancel</button>  \<button type="button" class="btn btn-success" id="confirm-button-ok">OK</button>  \</div>  \</div>  \</div>  \</div>');

Another problem is about Syntax error: that means you cant use this operator => for IE11 

For example: 

$(".button-confirm-modal").on('click', (e) => { }

this code doesn't work on IE 11 you get Syntax error but it is work on EDGE and another browsers. 

you have to use this format for IE 11

$('.button-confirm-modal').click(function (e) { }

I'm new to programming. it was not easy to understand. 


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>