siso
siso

Reputation: 267

jQuery js file not loading

Why my custom js is loading but jquery-1.11.1.js is not loading, tried placing it in same folder as my custom js(StartPage.js), but still on firebug console its showing not found.

<html>
<head>
    <title>title</title>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery-1.11.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/StartPage.js"></script>
</head>
<body>
    <%@ include file="/html/StartPage.html"%>
</body>
</html>

enter image description here

enter image description here

Upvotes: 0

Views: 300

Answers (2)

siso
siso

Reputation: 267

My bad...

I was running the application by right-clicking on index.jsp from eclipse, that's why it was getting confused in resolving js file paths, and StartPage.js was loading from Spring container, as /StartPage was getting resolved from @RequestMapping from the controller.

Now I ran whole project on the server and the path is resolved for all js files(using ${PageContext.request.contextPath}).

Upvotes: 1

Ramzan Zafar
Ramzan Zafar

Reputation: 1600

Try this path and try clearing cache of broswer

you are missing "js" from your path try the following path

 ${pageContext.request.contextPath}/js/jquery-1.11.1.js

Upvotes: 0

Related Questions