I am working on page layout in SharePoint 2016 on prem, and using jquery for some simple manipulation.
I need to load my .js - file in edit mode panel only. I reference the .js-file like this in the page layout:
<PublishingWebControls:EditModePanel runat="server">
<!-- Styles for edit mode only-->
<script type="text/javascript" src='http://absolutepath/Style%20Library/myScript.js'></script>
</PublishingWebControls:EditModePanel>
This is my jQuery code:
$(document).ready(function() {
$('input[title="Til"]').click (function () {
alert('clicked');
$("input[Title='Fra']").attr("disabled", "");
var checkbox = $("input[id *= 'checkboxrutine']");
for(let i = 0; i < checkbox.length; i++)
{
$('input[id="' + checkbox[i].id + '"]').attr("checked", "checked");
}
}); // end of click
}); // end of documen tready function
It works in Chrome and FireFox, but only not in IE. I have done iisreset and published the .js - file, and clicked ctrl+f5 hundred times . I cannot even find the script in IE by using the developer tools (f12).
Am I doing anything wrong here with regards to referncing the file ? Or is there any issues with the jQuery code that does not work in IE ? What can I do to make this work in IE ? Please advice.