I think there is a strange problem with jquery I got this exception when page load here is my markup :
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="../Layouts/en-us/css/custom.css" rel="stylesheet" />
<link href="../Layouts/en-us/css/jquery-ui.css" rel="stylesheet" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="../ckeditor/ckeditor.js"></script>
<script src="../ckeditor/adapters/jquery.js"></script>
<script src="/Layouts/en-us/js/jquery-ui.min.js"></script>
</asp:Content>
here is the function that causes error
$(function () {
$("#tabs").tabs();
if ($("#ListBoxPages").val() == null) {
$("#tabs").css("display", "none");
}
$("#ListBoxPages").change(function () {
$("#tabs").css("display", "block");
});
});
All relative paths to Layouts and jquery were copied from another markup which works pretty fine with no error
I can see that you are loading jquery twice so try to remove that
<script src="/Layouts/en-us/js/jquery-ui.min.js" />
and keep only -
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" />
then use below code in place of your function (First check by changes in this function then try with removing that jquery-ui.min.js)
$( document ).ready(function() {
$("#tabs").tabs();
if ($("#ListBoxPages").val() == null) {
$("#tabs").css("display", "none");
}
$("#ListBoxPages").change(function () {
$("#tabs").css("display", "block");
});
});
$("#tabs").tabs(); requires Jquery.UI just include
<script src="/Layouts/en-us/js/jquery-ui.min.js" />
or use CDN
<scriptsrc="https://code.jquery.com/ui/1.12.1/jquery-ui.js"integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30="crossorigin="anonymous"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With