Hi everyone,
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
-
<a href="?p=blablabla&id="
-
the string of the parameter p will be set to the string p
-
String p = request.getParameter("p");
-
String id = request.getParameter("id");
-
String img = request.getParameter("img");
-
p = p != null ? p : "";
-
after that the string p will be used to get a file loaded inside a div (everytime when i click on another link it will send that string and will load the page inside the div.
-
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