Click to See Complete Forum and Search --> : how to import a javascript into my jsp


msg2ajay
06-21-2007, 03:38 AM
HI,
i hav done like this but i am not able to access my javascript to my jsp... it any thing wrong with my src=""

<head>
<script language="javascript" src="../myJs/myJavaScript.js"></script>
</head>
my folder structure is

myJS
- build
- myweb
-META-INF
-myJs
-myJavaScript.js
- web
-index.jsp
-WEB-INF




thx & rgds,
Ajay

toicontien
06-21-2007, 09:26 AM
JavaScript cannot interact with JSP. JavaScript can only interact with the web page, which is the output of JSP. Many web server setups have all data that can be accessed via the WWW in one folder. Are you sure you can have the myJs directory outside the web directory? I'd think the myJs directory should be inside the web directory in your case.

Try going to the JavaScript file's URL directly in your browser. Do you have this site live right now, so we can see it?