Sharepoint 2013 sweetalert2 ie doesn't work
-
05-02-2021 - |
Question
I was making a small notice board for users with sweetalert2. it is working well chrome. Testing with little script trigger button its working good chrome but still not showing ie.
I have to say my script working good index.html both browser, i am realy confused:)
here my code;
<script type="text/javascript" src="SiteAssets/SweetAlert/sweetalert2.all.min.js"></script>
<link rel="stylesheet" href="/SiteAssets/SweetAlert/sweetalert2.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="/SiteAssets/SweetAlert/promise-polyfill.js"></script>
<script>
$( "#btn22" ).click(function() {
debugger;
Swal(
'The Internet?',
'That thing is still around?',
'question'
)
console.log('tıklandı');
});
</script>
Solution
Note that SweetAlert2 does not and will not provide support or functionality of any kind on IE10 and lower.
Refer to this link: https://github.com/sweetalert2/sweetalert2
By default, the SharePoint 2013 renders the content in IE10 mode defined in master page.
<meta http-equiv="X-UA-Compatible" content="IE=10" />
Update:
You can change it in the master page. But you need to note that the browser support in SharePoint 2013: https://docs.microsoft.com/en-us/sharepoint/install/browser-support-planning
As a workaround, you can force the specific page to use IE 11, you could create your own page file with HTML and load the page using iframe
.
Here is a demo: https://paultavares.wordpress.com/2015/01/20/how-to-render-a-sharepoint-page-in-ie-using-edge-mode-without-changing-the-master-page/