Click here to Skip to main content
16,021,181 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java
while(rs.next())
{
    out.print("<table><tbody><tr><td>"+rs.getString(2));              
    out.print("  <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>");
    out.print(" <script src=\"js/index.js\"></script>");
    // out.print("<button type=\"button\" onclick=friendnamebtn() id=\"btn_friends\">");
    out.print("<button type=\"button\" onclick='javascript:return friendnamebtn(this)' id=\"btn_friends\">");
    out.print("Add" + rs.getString(2));
    out.print("</button>");
    out.print("</td></tr></tbody></table>");
}


made a click event using javascript

JavaScript
function friendnamebtn()
{
     var friends = document.getElementById("btn_friends");
     alert("add");
}


Now i want to link the contact which is logged in (i can get it's id using session) and the person whom i want to connect using javascript. but where to write my database code? cause i have event in javascript.
Posted
Updated 15-Oct-15 21:50pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900