You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ri...@netzero.com on 2002/09/20 18:38:38 UTC

can javascript execute a servlet?

i don't want the user's screen to REFRESH each time they click a servlet inside an <A> tag. Can Javascript execute a servlet?

thanks!
Rich




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: can javascript execute a servlet?

Posted by adi <ad...@myrealbox.com>.
Hello,

javascript can execute aservlet.
You need to call the servlet url and get the data back into
a javscript object.
This is an example how i did it with IE:

<script language=javascript>
dnld=document.getElementById('linesintable');
dnld.startDownload(servlet_url,getdata);
function getdata(data){
	status=data.split("\n")
}
</script>

and in the html you have something like this:

<div id="linesintable"
style="visibility:hidden;behavior:url'#default#download')
 servleturl="http://Servlets/My.Servlet"></div>"


hope it helps.

the only bad thing about it is that you will need 2 different codes
for netscape and IE

Adi


-----Original Message-----
From: richdiaz99@netzero.com [mailto:richdiaz99@netzero.com]
Sent: Friday, September 20, 2002 5:39 PM
To: tomcat-user@jakarta.apache.org
Subject: can javascript execute a servlet?


i don't want the user's screen to REFRESH each time they click a servlet
inside an <A> tag. Can Javascript execute a servlet?

thanks!
Rich




--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>