on ‎2005 Mar 18 4:20 PM
Hi all,
I would like to create a central javascript file for my project, and include it in every JSP.
1. I am assuming that the script file should go in the sister directory of the image folder. Is that true?
2. Can anyone provide the code to include this file. With htmlb generating html for me, I sometimes get confused where to put things.
thanks in advance for your help
Mariana
Request clarification before answering.
Hi Mariana,
Put it under following folder.
dist->
scripts
String url = componentRequest.getWebResourcePath() + "/scripts/xx.js";
PS: Please award points if i am of any help to you. thank you.
Message was edited by: Prakash Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Prakash,
I thought that might be it, since it is the way we access images too.
Just 2 quick questions if anyone can help?
I would like this file to be common to the portal, not to just the iview. Is there anywhere in the portal that I could put this file to be available to ALL my jsps, regardless of which project they are in. Sort of like a server/common/scripts directory?
Thank you in advance
Mariana
Hey prakash,I have a similar situation.
I have a .js file that stores client eventing which is same for several other Iviews.I have imported that file into dist>scripts folder.
I have used the line u pasted in this post.
If i use a function defined in the .js file, it gives me an error.
<a href ="javascript:sayHi()" >Click here</a>
i get a script error: sayHi not defined.
am i missing something else?
Thanx.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.