i am trying to add date picker to my textbox. i have added all needed java scripts and referenced it properly but it is giving me following error.
"NetworkError: 404 Not Found - http:/Scripts/jquery-1.5.1.min.js"
i am trying to add date picker to my textbox. i have added all needed java scripts and referenced it properly but it is giving me following error.
"NetworkError: 404 Not Found - http:/Scripts/jquery-1.5.1.min.js"
Share Improve this question asked Dec 18, 2014 at 6:40 Nikhil SaswadeNikhil Saswade 1772 gold badges6 silver badges17 bronze badges 2- Please show your JS included code. – Sadikhasan Commented Dec 18, 2014 at 6:41
- <script type="text/javascript" > $(document).ready(function () { $('.datepicker').datepicker(); }); function onSubmit() { var empId = document.getElementById('EmpId'); var deptid = document.getElementsById('DeptId'); if (empId.value.trim() == 0 || isNaN(parseInt(empId.value))) { empId.value = '0'; } } </script> – Nikhil Saswade Commented Dec 18, 2014 at 9:04
3 Answers
Reset to default 2This problem will occur if jquery-1.5.1 is missing from script folder. Check the path for file jquery-1.5.1.min.js
. If it's a webapp you are running, it would be placed inside <webapp-root>/Scripts
. Also, as per the error it seems that you have e one extra directory back while setting the path for this file.
NuGet
package to be installed using mand - Install-Package jQuery -Version 1.5.1
as specified on this link.
Use this to include jQuery:
<script src="/Scripts/jquery-1.5.1.min.js"></script>
Add this line before <html>
tag
<%@ taglib uri="http://java.sun./jsp/jstl/core" prefix="c"%>
Then, put this code in your HTML <head></head>
<script src='<c:url value="/Scripts/jquery-1.5.1.min.js"/>'></script>