I hope there is somebody that can help me.
I normally am programming in jsp or java, but i now have to program in javascript. I hope somebody can help me or get me in too the right direction.
normally when iam using jsp i would add these codes.
when i click on a link it will send the string blablabla of the parameter p
Expand|Select|Wrap|Line Numbers
- <a href="?p=blablabla&id="
Expand|Select|Wrap|Line Numbers
- String p = request.getParameter("p");
- String id = request.getParameter("id");
- String img = request.getParameter("img");
- p = p != null ? p : "";
Expand|Select|Wrap|Line Numbers
- String includeDir = "/content";
- if (p.length() > 0 && new File(request.getRealPath(includeDir + "/" + p + ".jsp")).exists())
- {
- pageContext.include(includeDir + "/" + p + ".jsp");
- }
- else if (p.length() > 0 && new File(request.getRealPath(includeDir + "/" + p)).exists())
- {
- pageContext.include(includeDir + "/" + p);
- }
- else
- {
- pageContext.include(includeDir + "/" + "home.jsp");
- }
now is my question how can i do this kind of thing in javascript. Is it even possible. Could you give me an example or what kind of things i need to use or where to look. I can also send the whole jsp document if its easier to help.
(the thing is what i want. When i click on a link, i want that the content of multiple div's are changed depending on the parameter that the link sends.
i.e. one div must load a html file with txt. and one div must load a picture. and in one div the txt must be changed)
thanks in advance.
Greetings
Martin Janssen