随笔分类 -  javascript学习笔记

摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb23 阅读全文
posted @ 2012-11-02 10:09 yuloe2012 阅读(209) 评论(0) 推荐(0)
摘要:JavaScript中编码有三种方法:escape、encodeURI、encodeURIComponent C#中编码主要方法:HttpUtility.UrlEncode、Server.UrlEncode、Uri.EscapeUriString、Uri.EscapeDataString JavaScript中的还好,只提供了三个,C#中主要用的就有这么多,还没有列出其他编码(HTML),一多就弄不明白,弄不明白就心生恐惧,心生恐惧就变得苦逼,本文就向大家详细解释在JavaScript及C#中如何对URI进行编码的方法(注:本文不涉及到其他编码)。escape:不推荐使用 原因:eac... 阅读全文
posted @ 2012-10-29 17:53 yuloe2012 阅读(195) 评论(0) 推荐(0)
摘要:它的功能是把对应的字符串解析成JS代码并运行比如说要运行一个可变的方法例 1function name1(){……}function name2(){……}var m="name1";eval(m+'()');//运行name1();m='name2';eval(m+'()');//运行name2();例 2<SCRIPT language="javascript">function showsubmenu(sid){whichEl = eval("submenu" + si 阅读全文
posted @ 2012-10-13 13:41 yuloe2012 阅读(242) 评论(0) 推荐(0)
摘要:<script type="text/javascript" language="javascript"> function mouseover(obj) { //document.getElementById("divInfor").style.display = "block"; obj = obj.parentNode; obj = obj.nextSibling; node = getNextElement(obj); node.style.display = "block" 阅读全文
posted @ 2012-10-11 13:35 yuloe2012 阅读(422) 评论(0) 推荐(0)
摘要:<input type="text" id="searchKey" name="key" class="textBox" value="请在此处输入关键字" onfocus="if(this.value==this.defaultValue)this.value=''" onblur="if(this.value.replace(/ /ig,'')=='')this.value=this.defaultValue 阅读全文
posted @ 2012-09-19 17:38 yuloe2012 阅读(254) 评论(0) 推荐(0)
摘要:<a runat="server" onclick="document.getElementById('BtSend').click();">测试链接</a><asp:Button ID="BtSend" runat="server" Text="重新发送" OnClick="BtSend_Click" />可以把按钮设置为隐藏。点击链接,就会触发Button事件。 阅读全文
posted @ 2012-09-18 12:50 yuloe2012 阅读(2382) 评论(0) 推荐(0)