Datepicker not working after upgrade to jquery 3.3.1 - javascript

Im working a C# MVC project. Datepicker stopped working and I narrowed it down to what is causing it but don't have a solution...
I change one line of code in the Layout page and it breaks the date picker. Specifically going from jquery-1.11.1.min.js to jquery-3.3.1.min.js
This layout works:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>#ViewBag.Title</title>
<script src="~/Scripts/jquery-1.11.1.min.js"></script>
<script src="~/Scripts/modernizr-2.6.2.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
<script src="~/Scripts/jquery.timepicker.min.js"></script>
<script src="~/Scripts/jquery-ui-1.12.1.min.js"></script>
<script src="~/Scripts/moment.min.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
<script src="~/Scripts/bootstrap-datepicker.min.js"></script>
<script src="~/Scripts/mvcfoolproof.unobtrusive.min.js"></script>
<script src="~/Scripts/MvcFoolproofJQueryValidation.min.js"></script>
<link href="~/Content/jquery.timepicker.css" rel="stylesheet" />
<link href="~/Content/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/bootstrap-datepicker.css" rel="stylesheet" />
<link href="~/Content/font-awesome.css" rel="stylesheet" />
<link href="~/Content/themes/base/jquery-ui.min.css" rel="stylesheet" />
<link href="~/Content/themes/base/jquery.ui.theme.css" rel="stylesheet" />
<link href="~/Content/Menu.css" rel="stylesheet" />
<link href="~/Content/Site.css" rel="stylesheet" />
</head>
This layout breaks datepicker:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>#ViewBag.Title</title>
<script src="~/Scripts/jquery-3.3.1.min.js"></script>
<script src="~/Scripts/modernizr-2.6.2.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
<script src="~/Scripts/jquery.timepicker.min.js"></script>
<script src="~/Scripts/jquery-ui-1.12.1.min.js"></script>
<script src="~/Scripts/moment.min.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
<script src="~/Scripts/bootstrap-datepicker.min.js"></script>
<script src="~/Scripts/mvcfoolproof.unobtrusive.min.js"></script>
<script src="~/Scripts/MvcFoolproofJQueryValidation.min.js"></script>
<link href="~/Content/jquery.timepicker.css" rel="stylesheet" />
<link href="~/Content/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/bootstrap-datepicker.css" rel="stylesheet" />
<link href="~/Content/font-awesome.css" rel="stylesheet" />
<link href="~/Content/themes/base/jquery-ui.min.css" rel="stylesheet" />
<link href="~/Content/themes/base/jquery.ui.theme.css" rel="stylesheet" />
<link href="~/Content/Menu.css" rel="stylesheet" />
<link href="~/Content/Site.css" rel="stylesheet" />
</head>
So the Datepicker doesn't pop a calendar below the input, just a thick white line above the input.
I haven't been able to resolve this. Help?

I needed Bootstrap.Datepicker v1.7.1....
It brought in some new .css files and overwrote some of what was in the project and now the datepicker calendar is working.
I neededthe new code in bootstrap-datepicker.css . The code I had was not up to date. Also needed the new code in bootstrap-datepicker.js and bootstrap-datepicker.min.js
I deleted everything else the Package Manager brought in and everything works as intended.

Related

ASP.net MVC: JQuery DataTable Styling problem with bootstrap

i use JQuery DataTable plugin in a Asp.net MVC Project. JQuery, DataTable and Bootstrap are installed by Nugets. Adding the reference jquery.dataTables.min.css to the Layout make a styling troubles and problems.
the order of call:
<head>
<link href="~/Content/DataTables/css/jquery.dataTables.min.css" rel="stylesheet" />
<link href="~/Content/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="~/Content/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="~/Content/jquery-ui.css" rel="stylesheet" />
<link href="~/Content/website.css" rel="stylesheet" type="text/css" />
<script src="~/Scripts/jquery-3.6.0.min.js"></script>
<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
<script src="~/Scripts/jquery-ui.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
<script src="~/Scripts/DataTables/jquery.dataTables.min.js"></script>
<script src="~/Scripts/DataTables/dataTables.bootstrap4.min.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
<script src="~/Scripts/website.js"></script>
<script src="~/Scripts/moment.min.js"></script>
#RenderSection("scripts", required: false)
Thank you !

Broken Jquery Ui style Datepicker

I am trying to use a jquery UI date picker on a datefield in django.
but for some reason, it looks very bad. and the input field itself is wired.
I would like to know what I am doing wrong? how can I fix the view?
there is also (in green) a gap in the field how can I remove the gap?.
picture:
JS
$("#id_start_time").datepicker({});
my head of the page:
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<!-- Data Tables-->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.css">
<link rel="stylesheet" type="text/css"
href="https://cdn.datatables.net/rowreorder/1.2.6/css/rowReorder.dataTables.min.css">
<link rel="stylesheet" type="text/css"
href="https://cdn.datatables.net/responsive/2.2.3/css/responsive.dataTables.min.css">
<script type="text/javascript" charset="utf8" src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script type="text/javascript" charset="utf8"
src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" charset="utf8"
src="https://cdn.datatables.net/rowreorder/1.2.6/js/dataTables.rowReorder.min.js"></script>
<script type="text/javascript" charset="utf8"
src="https://cdn.datatables.net/responsive/2.2.3/js/dataTables.responsive.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/js/standalone/selectize.min.js"
integrity="sha256-+C0A5Ilqmu4QcSPxrlGpaZxJ04VjsRjKu+G82kl5UJk=" crossorigin="anonymous"></script>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.bootstrap3.min.css"
integrity="sha256-ze/OEYGcFbPRmvCnrSeKbRTtjG4vGLHXgOqsyLFTRjg=" crossorigin="anonymous"/>
I can't see jQuery ui css there.
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css">

jQuery plugin - ReferenceError: require is not defined

I've checked other answers on here and I don't think there's one that covers my problem. I am trying to include two JQuery plugins (Datepicker and Select2) and I just want to download them, include them in the head of my site and initiate them in...
$(document).ready(function() {
// HERE!
$('[data-toggle="datepicker"]').datepicker();
$(".js-example-basic-single").select2();
});
...as both suggest I should be able to do... but both give me a ReferenceError: require is not defined in the console and if I go into the .js files and comment out the offending line (as suggested in other answers) the plugin doesn't work at all and I just get an undefined function in the console.
I'm sure this is something simple that's simply outside of my understanding, if anyone can help, that would be great.
This is the head:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- fonts -->
<link rel="stylesheet" type="text/css" href="/fonts/roboto.css" media="screen" />
<!-- end fonts -->
<link rel="stylesheet" type="text/css" href="/css/general.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/message_boxes.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/loading_screen.css" media="screen" />
<link href="/css/datepicker.css" rel="stylesheet">
<script type="text/javascript" src="/js/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="/js/retina.min.js"></script>
<script type="text/javascript" src="/js/jscolor.min.js"></script>
<script type="text/javascript" src="/js/datepicker.js"></script>
<script type="text/javascript" src="/js/general.js"></script>
<script type="text/javascript" src="/js/message_boxes.js"></script>
<script type="text/javascript" src="/js/loading_screen.js"></script>
<script type="text/javascript" src="/js/tipped.js"></script>
<link rel="stylesheet" type="text/css" href="/css/tipped.css" />
<link rel="stylesheet" type="text/css" href="/css/icheck_blue.css" />
<script type="text/javascript" src="/js/icheck.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
</head>

KendoJs is not defined

I have a code to call kendoJS library like this:
jQuery(function(){
jQuery("#TabStrip").kendoTabStrip({
"animation":false
});
});
When I run the code, in console I found an error like this:
When I try to add kendo library:
<link href="http://localhost/CST/public/kendo/2013.1.514/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/CST/public/kendo/2013.1.514/kendo.default.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://localhost/CST/public/kendoJs/2013.1.514/kendo.all.min.js"></script>
<link href="http://localhost/CST/public/css/jquery.pnotify.default.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/CST/public/css/jquery.jOrgChart.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/CST/public/css/DataTable.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/CST/public/css/custom.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/CST/public/css/prettify.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/CST/public/css/getorgchart.css" rel="stylesheet" type="text/css" />-->
<script type="text/javascript" src="http://localhost/CST/public/js/prettify.js"></script>
<script type="text/javascript" src="http://localhost/CST/public/js/data.js"></script>
<script type="text/javascript" src="http://localhost/CST/public/js/jquery.min.js"></script>
<script type="text/javascript" src="http://localhost/CST/public/js/jquery.jOrgChart.js"></script>
<script type="text/javascript" src="http://localhost/CST/public/js/jquery.jOrgChart3.js"></script>
<script type="text/javascript" src="http://localhost/CST/public/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://localhost/CST/public/js/setting.js"></script>
I found an error like this:
jQuery is not defined. Why I get an error like that?. The css and javascript in different library.
<link href="http://localhost/CST/public/kendo/2013.1.514/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/CST/public/kendo/2013.1.514/kendo.default.min.css" rel="stylesheet" type="text/css" />
***<!--jquery.min.js should be before kendo.all.min.js -->***
<script type="text/javascript" src="http://localhost/CST/public/js/jquery.min.js"></script>
<script type="text/javascript" src="http://localhost/CST/public/kendoJs/2013.1.514/kendo.all.min.js"></script>
<link href="http://localhost/CST/public/css/jquery.pnotify.default.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/CST/public/css/jquery.jOrgChart.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/CST/public/css/DataTable.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/CST/public/css/custom.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/CST/public/css/prettify.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/CST/public/css/getorgchart.css" rel="stylesheet" type="text/css" />-->
<script type="text/javascript" src="http://localhost/CST/public/js/prettify.js"></script>
<script type="text/javascript" src="http://localhost/CST/public/js/data.js"></script>
<script type="text/javascript" src="http://localhost/CST/public/js/jquery.jOrgChart.js"></script>
<script type="text/javascript" src="http://localhost/CST/public/js/jquery.jOrgChart3.js"></script>
<script type="text/javascript" src="http://localhost/CST/public/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://localhost/CST/public/js/setting.js"></script>

CSS of Grocery CRUD not loading

I've installed Grocery-Crud and it works! But there is no any css files were loaded on page. I have standard code grocery_crud gives to users, so this is what I see, when I want to see page's code:
<meta charset="utf-8" />
<link type="text/css" rel="stylesheet" href="http://localhost/grocery.ru/assets/grocery_crud/themes/datatables/css/demo_table_jui.css" />
<link type="text/css" rel="stylesheet" href="http://localhost/grocery.ru/assets/grocery_crud/css/ui/simple/jquery-ui-1.9.0.custom.min.css" />
<link type="text/css" rel="stylesheet" href="http://localhost/grocery.ru/assets/grocery_crud/themes/datatables/css/datatables.css" />
<link type="text/css" rel="stylesheet" href="http://localhost/grocery.ru/assets/grocery_crud/themes/datatables/css/jquery.dataTables.css" />
<link type="text/css" rel="stylesheet" href="http://localhost/grocery.ru/assets/grocery_crud/themes/datatables/extras/TableTools/media/css/TableTools.css" />
<link type="text/css" rel="stylesheet" href="http://localhost/grocery.ru/assets/grocery_crud/css/jquery_plugins/fancybox/jquery.fancybox.css" />
<script src="http://localhost/grocery.ru/assets/grocery_crud/js/jquery-1.8.2.min.js"></script>
<script src="http://localhost/grocery.ru/assets/grocery_crud/js/jquery_plugins/ui/jquery-ui-1.9.0.custom.min.js"></script>
<script src="http://localhost/grocery.ru/assets/grocery_crud/themes/datatables/js/jquery.dataTables.min.js"></script>
<script src="http://localhost/grocery.ru/assets/grocery_crud/themes/datatables/js/datatables-extras.js"></script>
<script src="http://localhost/grocery.ru/assets/grocery_crud/themes/datatables/js/datatables.js"></script>
<script src="http://localhost/grocery.ru/assets/grocery_crud/themes/datatables/extras/TableTools/media/js/ZeroClipboard.js"></script>
<script src="http://localhost/grocery.ru/assets/grocery_crud/themes/datatables/extras/TableTools/media/js/TableTools.min.js"></script>
<script src="http://localhost/grocery.ru/assets/grocery_crud/js/jquery_plugins/jquery.fancybox.pack.js"></script>
<script src="http://localhost/grocery.ru/assets/grocery_crud/js/jquery_plugins/jquery.easing-1.3.pack.js"></script>
Is that means, that it loads these files? I thought it so. And this is what I see when I connect with controller "examples.php" (I'm nor writing this code, 'cause it basic files in grocery's archive): http://rghost.ru/46695190

Categories

Resources