52,797
社区成员
发帖
与我相关
我的任务
分享
<div id="idPostPanel">
<div style=" clear:both">
<input type="checkbox" id="idSelAllA" name="aaabbb" />全选 <a id="idDelAll" href="javascript::funcDelAllPost( 'idAllPost')" >删除</a>
</div>
<div style=" clear:both">
<div style=" clear:both;" ><input type="checkbox" value="pID1" name="name_postItem" /><a>测试1</a></div>
<div style=" clear:both;" ><input type="checkbox" value="pID2" name="name_postItem" /><a>测试1</a></div>
<div style=" clear:both;" ><input type="checkbox" value="pID3" name="name_postItem"/><a>测试1</a></div>
<div style=" clear:both;" ><input type="checkbox" value="pID4" name="name_postItem"/><a>测试1</a></div>
</div>
<div style=" clear:both">
<input type="checkbox" id="idSelAllB" />全选 <a id="A1" href="javascript::funcDelAllPost( 'idAllPost')">删除</a>
</div>
<!--javascript--->
<script type="text/javascript">
$( function()
{
function funcSelAll()
{
var checked = $(this).attr["checked"];
///checked 总为undefined
alert( $(this).attr["name"]);
///$(this).attr["name"] 总为undefined
if( checked == true)
{
$("input[name='name_postItem']").each
(
function ()
{
alert( "a" +$(this).attr["value"]);
$(this).attr["checked", true];
}
);
}
else
{
$("input[name='name_postItem']").each
(
function ()
{
alert( "b" + $(this).attr["value"]);;
$(this).attr["checked", false];
}
);
}
};
$("#idSelAllA").click( funcSelAll);
$("#idSelAllB").click( funcSelAll);
}
)
</script>
</div>
$("#idPostHis").click
( function()
{
function funcSuccess( result)
{
$("#idCont").html( result["d"]);
};
function funcError( xhr, ts)
{
alert(ts);
};
$.ajaxWebService( "/WebAjaxHelp.asmx/user_postInfo", "{}","json", funcSuccess,funcError );
///改为html 时 $("#idCont").html( result["d"]),啥也没显示;$("#idCont").html( result);是形如 ["d":"..."]样的数据。
}
);