I have a page (see image for a description), where the user has to choose a few options.
The idea is, you first click on a link in the box on top. Then enter a string in the searchbox which will show you relevant links in div1. When you click on a link in div1, relevant links will be displayed in div2. Then, after clicking on a link in div2, you'll get your result in div3.
I use ajax/javascript to create the links for div1 and 2 and to get the result for div3. The problem is, when I click on any link on my page, the searchbox will be cleared and contents in div1, div2 and the searchbox disappear even though the next step (e.g. displaying the next links) will be successfully executed.
What can I do to prevent this and preserve the contents of the searchbox, div1 and div2?
My current html-code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="icon" type="image/png" href="img/favicon.png">
<script src="inc/OnlineLogs.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<title>Logs</title>
</head>
<body onload="getOnlineIds()">
<div class="main">
<div class="navigation">
<a href="?loc=bad">bad</a> •
<a href="?loc=erf">erf</a> •
<a href="?loc=ess">ess</a> •
<a href="?loc=ffb">ffb</a> •
<a href="?loc=goe">goe</a> •
<a href="?loc=hal">hal</a> •
<a href="?loc=ham">ham</a> •
<a href="?loc=jen">jen</a> •
<a href="?loc=koe">koe</a> •
<a href="?loc=lei">lei</a> •
<a href="?loc=mue">mue</a> •
<a href="?loc=rau">rau</a> •
<a href="?loc=wil">wil</a> •
<a href="?loc=wit">wit</a>
</div>
<div class="search">
Suche: <input type="text" id="input" onkeyup="getOnlineComms()">
</div>
<div class="onlines" id="onlinelist"></div>
<div class="ids" id="ids"></div>
<div class="log" id="log"></div>
</div>
</body>
</html>
Also take a look at this fiddle: http://jsfiddle.net/X7aXG/1/
EDIT: I edited the problem description. Clicking any link will remove the contents of div1, div2 and the searchbox, even though the next step will be executed.