设为首页:
<a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://MyHomePage');" href='#' style='text-decoration: none'>设为首页</a>
收藏本站:
<a onclick="javascript:window.external.addFavorite('http://MyHomePage','我的网站');" href='#' style='text-decoration: none'>收藏本站</a>
联系我们:
<a href="mailto:kalin.zhang@hotmail.com">联系我们</a>
DropdownList选择内容改变时,自动跳转:
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(selObj,restore){ //v3.0
//eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
window.open(selObj.options[selObj.selectedIndex].value);
selObj.selectedIndex=0;
}
//-->
</script>
引用:
<asp:DropDownList ID="ddlSoft" runat="server" onChange="MM_jumpMenu(this,0)" DataTextField="Name"
DataValueField="Link" EnableTheming="false" Width="133px" />
下载文件不存在时,弹出错误信息:
<asp:HyperLinkField DataTextField="Title" DataNavigateUrlFields="Attach" Target="_blank" DataNavigateUrlFormatString="{0}">
<ItemStyle Width="379px" VerticalAlign="Bottom" />
</asp:HyperLinkField>
dtDowloads.Rows[i]["title"] = "<a href=\"javascript:alert('下载文件不存在或已被删除!')\">"+ dtDowloads.Rows[i]["title"]+"</a>";
JavaScript实用的一些技巧
<a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://MyHomePage');" href='#' style='text-decoration: none'>设为首页</a>
收藏本站:
<a onclick="javascript:window.external.addFavorite('http://MyHomePage','我的网站');" href='#' style='text-decoration: none'>收藏本站</a>
联系我们:
<a href="mailto:kalin.zhang@hotmail.com">联系我们</a>
DropdownList选择内容改变时,自动跳转:
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(selObj,restore){ //v3.0
//eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
window.open(selObj.options[selObj.selectedIndex].value);
selObj.selectedIndex=0;
}
//-->
</script>
引用:
<asp:DropDownList ID="ddlSoft" runat="server" onChange="MM_jumpMenu(this,0)" DataTextField="Name"
DataValueField="Link" EnableTheming="false" Width="133px" />
下载文件不存在时,弹出错误信息:
<asp:HyperLinkField DataTextField="Title" DataNavigateUrlFields="Attach" Target="_blank" DataNavigateUrlFormatString="{0}">
<ItemStyle Width="379px" VerticalAlign="Bottom" />
</asp:HyperLinkField>
dtDowloads.Rows[i]["title"] = "<a href=\"javascript:alert('下载文件不存在或已被删除!')\">"+ dtDowloads.Rows[i]["title"]+"</a>";
JavaScript实用的一些技巧