jsp页面通过ajax获得到servlet里面的值 如何让他赋值到同一个界面不同方法中?还是我思路错了!!! 220
<scripttype="text/javascript">functionailoli(id){//alert(id);$.post("GetJSONArrayData...
<script type="text/javascript">
function ailoli(id) {
//alert(id);
$.post("GetJSONArrayData.do",{"id":id}, function(jsonArray) {
//取json的一个属性
//data的值是{"dsdsdsd"}
$(jsonArray).each(function(){
$(".c").html(this.id);
})
},"json");
}
</script>
</head>
<body>
<div class="a">
<div class="b1"><input type="button" onclick="ailoli('id')" value="1"/></div>
<div class="b2">2</div>
<div class="b1">3</div>
<div class="b2">4</div>
<div class="b1">5</div>
<div class="b2">6</div>
</div>
<div class="c">
<table
style="BORDER-RIGHT: #ff69b4 3px dashed; BORDER-TOP: #ff69b4 3px dashed; BORDER-LEFT: #ff69b4 3px dashed; BORDER-BOTTOM: #ff69b4 3px dashed"
cellSpacing="0" cellPadding="0" bgColor="white" id="table6">
<tr>
<td>
<table borderColor="#ff69b4" align="center" bgColor="#ffccf5"
border="2" id="table7">
<tr>
<td style="FILTER: alpha(opacity = 100, style = 3)">
<p align="center">
<embed src="#赋值到这里并使用" width="750px" height="30px"
type="audio/mpeg" loop="-1" autostart="true" volume="0">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div> 展开
function ailoli(id) {
//alert(id);
$.post("GetJSONArrayData.do",{"id":id}, function(jsonArray) {
//取json的一个属性
//data的值是{"dsdsdsd"}
$(jsonArray).each(function(){
$(".c").html(this.id);
})
},"json");
}
</script>
</head>
<body>
<div class="a">
<div class="b1"><input type="button" onclick="ailoli('id')" value="1"/></div>
<div class="b2">2</div>
<div class="b1">3</div>
<div class="b2">4</div>
<div class="b1">5</div>
<div class="b2">6</div>
</div>
<div class="c">
<table
style="BORDER-RIGHT: #ff69b4 3px dashed; BORDER-TOP: #ff69b4 3px dashed; BORDER-LEFT: #ff69b4 3px dashed; BORDER-BOTTOM: #ff69b4 3px dashed"
cellSpacing="0" cellPadding="0" bgColor="white" id="table6">
<tr>
<td>
<table borderColor="#ff69b4" align="center" bgColor="#ffccf5"
border="2" id="table7">
<tr>
<td style="FILTER: alpha(opacity = 100, style = 3)">
<p align="center">
<embed src="#赋值到这里并使用" width="750px" height="30px"
type="audio/mpeg" loop="-1" autostart="true" volume="0">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询