Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can i insert jsp code in javascript or vice versa

Status
Not open for further replies.

hemuravi

Programmer
Jul 15, 2003
2
IN
can i insert javascript code in jsp or vice versa...pls let me know at the earliest possible.

Thanks and regards,
Hema
 
Here is code sample from one of jsp page..

<html>
<head>
<%@include file=&quot;/HTTPBaseJSP.jsp&quot; %>
<%@page import=&quot;com.sahinler.kasa.db.*&quot; %>
<%
DBKasaHareket dbKasaHareket = (DBKasaHareket)session.getValue(&quot;dbKasaHareket&quot;);
DBHesaplar dbHesaplar = (DBHesaplar)session.getValue(&quot;dbHesaplar&quot;);
%>
<script language=&quot;JavaScript&quot; >
function getTanim(slc){
document.forms[0].HesapTanim.value=hesapTanimArray[slc.selectedIndex];
}
var hesapKodArray = new Array();
var hesapTanimArray = new Array();
hesapKodArray[0]='Seciniz...';
<% for (int i=0;i<dbHesaplar.size();i++) {
DBHesap dbHesap = (DBHesap)dbHesaplar.get(i);
%>
hesapKodArray[<%=(i+1)%>]='<%=dbHesap.getKod()%>';
hesapTanimArray[<%=(i+1)%>]='<%=dbHesap.getTanim()%>';
<% } %>

</script>

A for loop used to be build a javascript array...

Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
 
jsp code in javascript >> possible
javascript code in jsp >> not possible

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top