<script language="javascript" type="text/javascript">
function openPetition(pid)
{
window.opener.location.href = "Jump.aspx?pid=" + pid;
window.self.close();
}
</script>
private void dgAllMailPetition_ItemDataBound_1(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.AlternatingItem ||
e.Item.ItemType == ListItemType.Item)
{
e.Item.Cells[0].Text =
"<a href='javascript:void(0);' onclick='openPetition("
+ this.dgAllMailPetition.DataKeys[e.Item.ItemIndex] +")' title='"+ e.Item.Cells[0].Text
+"'>"+ e.Item.Cells[0].Text +"</a>";
}
}
本文介绍了一种使用JavaScript实现的请愿链接功能,通过点击链接可以触发特定的页面跳转,并关闭当前窗口。该功能涉及到JavaScript的window对象操作及事件处理。
135

被折叠的 条评论
为什么被折叠?



