i want to post a string to
<li id="coz"><a
onclick="doRequest('zemberek.jsp','YAZI_COZUMLE');">Cozumle</a></li>
by Jsoup?.How can I do? here is original site : http://zemberek-web.appspot.com/
<html>
<head>
<script>
function doRequest(url, islem) {
var ajaxRequest = new AjaxRequest(url);
var hiddenField = document.getElementById("islem");
hiddenField.value = islem;
ajaxRequest.addNamedFormElements("giris", "islem");
ajaxRequest.sendRequest();
}
</script>
</head>
<body>
<big>Zemberek Demo</big>
<small>(<a href="http://code.google.com/p/zemberek">Zemberek
Proje Sitesi</a>)</small>
<div id="menu">
<ul id="nav">
<li id="denetle"><a
onclick="doRequest('zemberek.jsp', 'YAZI_DENETLE');">Denetle</a></li>
<li id="coz"><a
onclick="doRequest('zemberek.jsp','YAZI_COZUMLE');">Cozumle</a></li>
<li id="oner"><a onclick="doRequest('zemberek.jsp','ONER');">Oner</a></li>
<li id="ascii2tr"><a
onclick="doRequest('zemberek.jsp','ASCII_TURKCE');">Ascii->Tr</a></li>
<li id="tr2ascii"><a
onclick="doRequest('zemberek.jsp','TURKCE_ASCII');">Tr->ascii</a></li>
<li id="hecele"><a onclick="doRequest('zemberek.jsp','HECELE');">Hecele</a></li>
<li id="ayristir"><a
onclick="doRequest('zemberek.jsp','SACMALA');">Sacmala</a></li>
</ul>
</div>
<br>
<br>
<br>
<br>
<br>
<form id="form" action="#">
<P align=center><b>Islem yapilacak yaziyi asagidaki alana
giriniz.</b><br>
<textarea name="giris" rows="10" cols="60"></textarea> <input
type="hidden" name="islem" id="islem" /></P>
</form>
<br>
<div id="div"></div>
</body>
</html>
I think the anserw is the following if you look the request in Google Chrome developper tools you will see that when you click the generated url is the following for example :
giris=bnfhjfttgfhffgfg => is your string sent to the server.
So you can do in every programming language this following
Don't forget to UTF-8 encode your string for the query string
UPDATE
Here is an example that I've made
Output in the console :
The result from the request is a XML document. According to my experience I would use SAX instead of Java XML native implementation.
Simple and working solution with Jsoup:
Code
Result