Link to home
Start Free TrialLog in
Avatar of cofactor
cofactor

asked on

How do I import this library

How to import jquery library in a jsp  pop up  been opened by window.open.

I have the jquery.js  location :  webapps/js/jquery.js  folder

and pop up jsp location: webapps/pages/savework/pop_up.jsp

How do I import this jquery library in the pop up jsp page ?

what to write ?  The following does not work in pop up jsp

<script type="text/javascript"
      src="${pageContext.request.contextPath}/js/jquery.js"></script>

Avatar of rrz
rrz
Flag of United States of America image

>I have the jquery.js  location :  webapps/js/jquery.js  folder  
What is the full absolute path ?
I will presume that "webapps" is the folder in your web server that contains your web apps. If this is true, then instead of  using
>${pageContext.request.contextPath}/js/jquery.js  
you could try using
<%=application.getRealPath("/").substring(0, application.getRealPath("/").indexOf("webapps") + 7)%>/js/jquery.js

>and pop up jsp location: webapps/pages/savework/pop_up.jsp  
I don't think this will work. You will probably have to put pop_up.jsp inside of a web app.
ASKER CERTIFIED SOLUTION
Avatar of rrz
rrz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial