如题所述
如何在html标签的属性里引用一个jsp变量
out.println("<button class='btn-title' onclick='ajax_con(\""+title+"\")'>"+title+"</button>");
function ajax_con(title)
{
alert(title);
$.ajax
({
url:'chakan2.jsp',
type:'post',
data:{'con':t},
error:function(){alert("error");},
success:function(products){
$("#index_show_con").html(products);}
});
}
out.println("<button class='btn-title' onclick='ajax_con(\""+title+"\")'>"+title+"</button>");
function ajax_con(title)
{
alert(title);
$.ajax
({
url:'chakan2.jsp',
type:'post',
data:{'con':t},
error:function(){alert("error");},
success:function(products){
$("#index_show_con").html(products);}
});
}
温馨提示:答案为网友推荐,仅供参考