<?xml version="1.0" encoding="UTF-8"?>
  <feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html"><![CDATA[Flywe 技术园 - JavaScript]]></title>
  <subtitle type="html"><![CDATA[Webdesign_Css_Div_JavaScri&#112;t_ASP_ASP.NET_XML_SEO]]></subtitle>
  <id>http://www.flywe.net/</id>
  <link rel="alternate" type="text/html" href="http://www.flywe.net/" /> 
  <link rel="self" type="application/atom+xml" href="http://www.flywe.net/atom.asp" /> 
  <generator uri="http://www.pjhome.net/" version="2.8">PJBlog3</generator> 
  <updated>2009-10-17T15:01:09+08:00</updated>

  <entry>
	  <title type="html"><![CDATA[留言本过滤非法字符Js脚本]]></title>
	  <author>
		 <name>flywe</name>
		 <uri>http://www.flywe.net/</uri>
		 <email>fly_boy23@163.com</email>
	  </author>
	  <category term="" scheme="http://www.flywe.net/default.asp?cateID=7" label="JavaScript" /> 
	  <updated>2009-10-17T15:01:09+08:00</updated>
	  <published>2009-10-17T15:01:09+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;留言本方便了浏览者和网站主的一个沟通，可是有很多心怀不轨的浏览者，会在留言本里面插入一些非法字符，导致网站运行出问题，那么我们怎么样来过滤这些字符呢？看看下面的这些吧！<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Html：<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> &lt;html <a href="http://www.flywe.net/default.asp?cateID=13" target="_blank">xml</a>ns=&#34;<a href="http://www.w3.org/1999/xhtml" target="_blank" rel="external">http://www.w3.org/1999/xhtml</a>&#34;&gt; <br/>&lt;head runat=&#34;<a href="http://www.flywe.net/default.asp?cateID=10" target="_blank">server</a>&#34;&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;留言本过滤非法字符Js脚本 - <a href="http://www.flywe.net" target="_blank">Flywe</a> 技术园 &lt;/title&gt; <br/>&lt;/head&gt; <br/>&lt;body&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;form id=&#34;form1&#34; runat=&#34;<a href="http://www.flywe.net/default.asp?cateID=10" target="_blank">server</a>&#34;&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a href="http://www.flywe.net/default.asp?cateID=8" target="_blank">asp</a>:TextBox ID=&#34;TextBox1&#34; runat=&#34;<a href="http://www.flywe.net/default.asp?cateID=10" target="_blank">server</a>&#34; Width=&#34;298px&#34; TextMode=&#34;multiLine&#34;&gt; &lt;/<a href="http://www.flywe.net/default.asp?cateID=8" target="_blank">asp</a>:TextBox&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a href="http://www.flywe.net/default.asp?cateID=8" target="_blank">asp</a>:Button ID=&#34;Button1&#34; runat=&#34;<a href="http://www.flywe.net/default.asp?cateID=10" target="_blank">server</a>&#34; OnClick=&#34;Button1_Click&#34; Text=&#34;Button&#34; /&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/form&gt; <br/>&lt;/body&gt; <br/>&lt;/html&gt; </div></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;后台：<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> public static string SqlIns&#101;rtEncode(string strFromText) <br/>&nbsp;&nbsp;&nbsp;&nbsp;{ <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!System.String.IsNullOrEmpty(strFromText) &amp;&amp; strFromText != &#34;&#34;) <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//strFromText = strFromText.Replace(&#34;;&#34;, &#34;;&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;!&#34;, &#34;!&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//strFromText = strFromText.Replace(&#34;@&#34;, &#34;@&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;$&#34;, &#34;$&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;*&#34;, &#34;*&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;(&#34;, &#34;(&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;)&#34;, &#34;)&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;-&#34;, &#34;-&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;+&#34;, &#34;+&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//strFromText = strFromText.Replace(&#34;=&#34;, &#34;=&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;|&#34;, &#34;|&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;\\&#34;, &#34;\&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//strFromText = strFromText.Replace(&#34;/&#34;, &#34;/&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//strFromText = strFromText.Replace(&#34;:&#34;, &#34;:&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;\&#34;&#34;, &#34;&#34;&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;&#39;&#34;, &#34;&#39;&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34; &lt;&#34;, &#34;&lt;&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34; &#34;, &#34; &#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;&gt;&#34;, &#34;&gt;&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34; &#34;, &#34; &#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strFromText = strFromText.Replace(&#34;\n&#34;, &#34; &lt;br /&gt;&#34;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return strFromText; <br/>&nbsp;&nbsp;&nbsp;&nbsp;} <br/>&nbsp;&nbsp;&nbsp;&nbsp;protected void Button1_Click(object sender, EventArgs e) <br/>&nbsp;&nbsp;&nbsp;&nbsp;{ <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(SqlIns&#101;rtEncode(TextBox1.Text)); <br/>&nbsp;&nbsp;&nbsp;&nbsp;} </div></div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.flywe.net/article/javascript/GuestBook_js.html" /> 
	  <id>http://www.flywe.net/default.asp?id=891</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[用JS来操作Cookie的一个简单例子]]></title>
	  <author>
		 <name>flywe</name>
		 <uri>http://www.flywe.net/</uri>
		 <email>fly_boy23@163.com</email>
	  </author>
	  <category term="" scheme="http://www.flywe.net/default.asp?cateID=7" label="JavaScript" /> 
	  <updated>2009-09-25T15:20:18+08:00</updated>
	  <published>2009-09-25T15:20:18+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;网站经常用到的一个东西用来暂存一些相关信息的Cookie有优点也有缺点，它能够不占用<a href="http://www.flywe.net/default.asp?cateID=10" target="_blank">服务器</a>资源，存储在客户端的电脑里，可这样也有一定的危险性，因为相关信息比如说登录某个网站的用户名和密码之类的信息，都会存在客户端的电脑里，这样会被某些“有心之人”利用，所以，有些人习惯在公共场合使用完电脑后清掉Cookie信息，当然前提是此电脑未“养马”，不过本文讨论文的问题不是Cookie的安全问题，而是一个简单的利用<a href="http://www.flywe.net/default.asp?cateID=7" target="_blank">js</a>来操作Cookie的例子，一起看看吧。。。<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;script type=&#34;text/javascript&#34;&gt;　<br/>function Set(Cookie_name)　　<br/>{　　<br/>　var Then = new Date()　　<br/>　Then.setTime(Then.getTime() + 1*3600000 ) //小时　　<br/>　document.cookie = Cookie_name+&#34;=true;expires=&#34;+ Then.toGMTString()　　<br/>}　　<br/>function Get(Cookie_name)　　<br/>{　　<br/>　var cookieString = new String(document.cookie)　　<br/>　var cookieHeader = Cookie_name+&#34;=&#34;　　<br/>　var beginPosition = cookieString.indexOf(cookieHeader)　　<br/>　if (beginPosition != -1) //cookie已经设置值，应该 不显示提示框　　<br/>　{　　<br/>　　 alert(Cookie_name+&#34;返回&#34;+cookieString.substring(beginPosition + cookieHeader.length));　　<br/>　}　　<br/>　else　//cookie没有设置值，应该显示提示框　　<br/>　{　　<br/>　 alert(&#34;Cookie 未找到!&#34;);　　<br/>　}　　<br/>}　　<br/>function Move(Cookie_name)　　<br/>{　　<br/>　document.cookie = Cookie_name+&#34;=;expires=Fri, 02-Jan-1970 00:00:00 GMT&#34;;　　<br/>}　　<br/>&lt;/script&gt;　<br/>&lt;P&gt;&lt;INPUT onclick=&#34;Set(&#39;steven lu&#39;)&#34; type=button value=设置cookie值&gt;&lt;/P&gt;　<br/>&lt;P&gt;&lt;INPUT onclick=&#34;Get(&#39;steven lu&#39;)&#34; type=button value=查看cookie值&gt;&lt;/P&gt;　<br/>&lt;INPUT onclick=&#34;Move(&#39;steven lu&#39;)&#34; type=button value=清除cookie值&gt;</div></div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.flywe.net/article/javascript/js_cookie.html" /> 
	  <id>http://www.flywe.net/default.asp?id=887</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[利用JS接收URL参数]]></title>
	  <author>
		 <name>flywe</name>
		 <uri>http://www.flywe.net/</uri>
		 <email>fly_boy23@163.com</email>
	  </author>
	  <category term="" scheme="http://www.flywe.net/default.asp?cateID=7" label="JavaScript" /> 
	  <updated>2009-09-24T16:21:12+08:00</updated>
	  <published>2009-09-24T16:21:12+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;我们在制作网站的过程中，遇到某些效果需要通过Url来判断效果的显示，如果用程序来实现的话，有些时候会占用较大的资源，那么能不能通过<a href="http://www.flywe.net/default.asp?cateID=7" target="_blank">js</a>来接收Url参数呢？当然可以！<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;让我们来看看下面这段代码：<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">function request(paras){ <br/>var url = location.href;&nbsp;&nbsp; <br/>var paraString = url.substring(url.indexOf(&#34;?&#34;)+1,url.length).split(&#34;&amp;&#34;);&nbsp;&nbsp; <br/>var paraObj = {}&nbsp;&nbsp; <br/>for (i=0; j=paraString[i]; i++){&nbsp;&nbsp; <br/>paraObj[j.substring(0,j.indexOf(&#34;=&#34;)).toLowerCase()] = j.substring(j.indexOf <br/>(&#34;=&#34;)+1,j.length);&nbsp;&nbsp; <br/>}&nbsp;&nbsp; <br/>var returnValue = paraObj[paras.toLowerCase()];&nbsp;&nbsp; <br/>if(typeof(returnValue)==&#34;undefined&#34;){&nbsp;&nbsp; <br/>return &#34;&#34;;&nbsp;&nbsp; <br/>}else{&nbsp;&nbsp; <br/>return returnValue;&nbsp;&nbsp; <br/>}&nbsp;&nbsp; <br/>} <br/>var theurl <br/>theurl=request(&#34;url&#34;); <br/>if (theurl!=&#39;&#39;){ <br/>location=theurl <br/>}</div></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;通过上面这段代码就可以接收到Url参数了。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.flywe.net/article/javascript/js_url.html" /> 
	  <id>http://www.flywe.net/default.asp?id=886</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[非jQuery实现四个不同方向的滑动门效果]]></title>
	  <author>
		 <name>flywe</name>
		 <uri>http://www.flywe.net/</uri>
		 <email>fly_boy23@163.com</email>
	  </author>
	  <category term="" scheme="http://www.flywe.net/default.asp?cateID=7" label="JavaScript" /> 
	  <updated>2009-09-18T18:03:52+08:00</updated>
	  <published>2009-09-18T18:03:52+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;滑动门效果在网站上应用的很多，曾经很是风行了一段时间，现在好像慢慢淡了下来，不过有些效果在某些地方还是很有用的，今天的这个滑动门效果是四个方向，带滑动效果的一种滑动门效果，展示图是一种隐藏是的滑动效果，还有其他四个效果在压缩包里，喜欢的朋友们可以下下来研究一下。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://www.flywe.net/cs/jQuery/2/show_2.gif" border="0" alt=""/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><span style="font-size:10pt;line-height:100%;"><a target="_blank" href="http://www.flywe.net/cs/jQuery/2/" rel="external">非jQuery实现四个不同方向的滑动门效果------在线效果演示</a></span></strong><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><span style="font-size:10pt;line-height:100%;"><a target="_blank" href="http://u.xunzai.com/fileview_146361.html" rel="external">非jQuery实现四个不同方向的滑动门效果------源码下载</a></span></strong>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.flywe.net/article/javascript/unjQuery_hdm.html" /> 
	  <id>http://www.flywe.net/default.asp?id=884</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[jQuery实现内容隐藏式留言显示方式]]></title>
	  <author>
		 <name>flywe</name>
		 <uri>http://www.flywe.net/</uri>
		 <email>fly_boy23@163.com</email>
	  </author>
	  <category term="" scheme="http://www.flywe.net/default.asp?cateID=7" label="JavaScript" /> 
	  <updated>2009-09-17T15:16:41+08:00</updated>
	  <published>2009-09-17T15:16:41+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在网站留言和一些文档性质的内容页面中，很多时候因为内容过多导致页面篇幅过长，我们可以通过下面这个方法来实现隐藏内容部分，点击标题显示其隐藏起来的内容页面，这样就减少了页面篇幅过长的问题。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://www.flywe.net/cs/jQuery/1/show_1.jpg" border="0" alt=""/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;主要实现的<a href="http://www.flywe.net/default.asp?cateID=7" target="_blank">js</a>代码如下：<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;script type=&#34;text/javascript&#34;&gt;<br/>$(document).ready(function(){<br/>&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;$(&#34;.accordion2 h3&#34;).<span style="color:Red">slice(0, 3)</span>.addClass(&#34;active&#34;);<br/>&#160;&#160;&#160;&#160;$(&#34;.accordion2 p&#34;).<span style="color:Red">slice(0, 3)</span>.show();<br/><br/>&#160;&#160;&#160;&#160;$(&#34;.accordion2 h3&#34;).click(function(){<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$(this).next(&#34;p&#34;).slideToggle(&#34;slow&#34;)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.siblings(&#34;p:visible&#34;).slideUp(&#34;slow&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$(this).toggleClass(&#34;active&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$(this).siblings(&#34;h3&#34;).removeClass(&#34;active&#34;);<br/>&#160;&#160;&#160;&#160;});<br/><br/>});<br/>&lt;/script&gt;</div></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;主要功能实现是通过上面的<a href="http://www.flywe.net/default.asp?cateID=7" target="_blank">js</a>代码，当然之前要调用jQuery的库文件，初始显示条数可以通过代码中红色部分来调整，现在是展开显示3条，如果全部关闭，可以把3改成0，如果要展开1条，可以把3改成1，以此类推。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><span style="font-size:10pt;line-height:100%;"><a target="_blank" href="http://www.flywe.net/cs/jQuery/1/" rel="external">jQuery实现内容隐藏式留言显示方式------在线效果演示</a></span></strong><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><span style="font-size:10pt;line-height:100%;"><a target="_blank" href="http://u.xunzai.com/fileview_145558.html" rel="external">jQuery实现内容隐藏式留言显示方式------源码下载</a></span></strong>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.flywe.net/article/javascript/jQuery_hidden_con.html" /> 
	  <id>http://www.flywe.net/default.asp?id=883</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[通过JS来验证表单项不能为空]]></title>
	  <author>
		 <name>flywe</name>
		 <uri>http://www.flywe.net/</uri>
		 <email>fly_boy23@163.com</email>
	  </author>
	  <category term="" scheme="http://www.flywe.net/default.asp?cateID=7" label="JavaScript" /> 
	  <updated>2009-09-11T17:57:06+08:00</updated>
	  <published>2009-09-11T17:57:06+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一个网站多少都会有一些表单项，比方说用户注册登录、调查、联系方式等等，都需要表单项来提交到<a href="http://www.flywe.net/default.asp?cateID=10" target="_blank">数据库</a>，有很多又是必填项，以往的做法是通过程序来进行表单项为空的判断，相对而言，这样有些占用资源，那么有没有办法通过<a href="http://www.flywe.net/default.asp?cateID=7" target="_blank">js</a>来实现这一功能呢？一起来看看这段代码吧！<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;script&nbsp;&nbsp;type=&#34;text/javascript&#34;&gt;<br/>&lt;!--<br/>function&nbsp;&nbsp;CheckForm()<br/>{&nbsp;&nbsp;<br/>if&nbsp;&nbsp;(document.form.name.value.length&nbsp;&nbsp;==&nbsp;&nbsp;0)&nbsp;&nbsp;{&nbsp;&nbsp;<br/>alert(&#34;请输入姓名!&#34;);<br/>document.form.name.focus();<br/>return&nbsp;&nbsp;false;<br/>}<br/>return&nbsp;&nbsp;true;<br/>}<br/>--&gt;<br/>&lt;/script&gt;</div></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;通过这段代码就可以进行表单项不能为空的一个判断，比较常用的一个<a href="http://www.flywe.net/default.asp?cateID=7" target="_blank">js</a>。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.flywe.net/article/javascript/js_null.html" /> 
	  <id>http://www.flywe.net/default.asp?id=878</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[jQuery帮助之选择器 表单对象属性 sel&#101;cted]]></title>
	  <author>
		 <name>flywe</name>
		 <uri>http://www.flywe.net/</uri>
		 <email>fly_boy23@163.com</email>
	  </author>
	  <category term="" scheme="http://www.flywe.net/default.asp?cateID=7" label="JavaScript" /> 
	  <updated>2009-09-10T15:00:16+08:00</updated>
	  <published>2009-09-10T15:00:16+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><span style="color:Blue"><span style="font-size:14pt;line-height:100%;">:sel&#101;cted</span></span></strong><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;匹配所有选中的option元素。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回值：Array&lt;Element&gt;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;示例：<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;查找所有选中的选项元素。<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>HTML 代码:</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> &lt;sel&#101;ct&gt;<br/>&nbsp;&nbsp;&lt;option value=&#34;1&#34;&gt;Flowers&lt;/option&gt;<br/>&nbsp;&nbsp;&lt;option value=&#34;2&#34; sel&#101;cted=&#34;sel&#101;cted&#34;&gt;Gardens&lt;/option&gt;<br/>&nbsp;&nbsp;&lt;option value=&#34;3&#34;&gt;Trees&lt;/option&gt;<br/>&lt;/sel&#101;ct&gt; </div></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>jQuery 代码:</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> $(&#34;sel&#101;ct option:sel&#101;cted&#34;) </div></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>结果:</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> &lt;option value=&#34;2&#34; sel&#101;cted=&#34;sel&#101;cted&#34;&gt;Gardens&lt;/option&gt; </div></div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.flywe.net/article/javascript/jQuery_selected.html" /> 
	  <id>http://www.flywe.net/default.asp?id=877</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[jQuery帮助之选择器 表单对象属性 enabled]]></title>
	  <author>
		 <name>flywe</name>
		 <uri>http://www.flywe.net/</uri>
		 <email>fly_boy23@163.com</email>
	  </author>
	  <category term="" scheme="http://www.flywe.net/default.asp?cateID=7" label="JavaScript" /> 
	  <updated>2009-09-09T14:34:00+08:00</updated>
	  <published>2009-09-09T14:34:00+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><span style="color:Blue"><span style="font-size:14pt;line-height:100%;">:enabled</span></span></strong><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;匹配所有可用元素。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回值：Array&lt;Element&gt;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;示例：<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;查找所有可用的input元素。<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>HTML 代码:</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> &lt;form&gt;<br/>&nbsp;&nbsp;&lt;input name=&#34;email&#34; disabled=&#34;disabled&#34; /&gt;<br/>&nbsp;&nbsp;&lt;input name=&#34;id&#34; /&gt;<br/>&lt;/form&gt; </div></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>jQuery 代码:</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> $(&#34;input:enabled&#34;) </div></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>结果:</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> &lt;input name=&#34;id&#34; /&gt; </div></div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.flywe.net/article/javascript/jQuery_enabled.html" /> 
	  <id>http://www.flywe.net/default.asp?id=876</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[jQuery帮助之选择器 表单对象属性 disabled]]></title>
	  <author>
		 <name>flywe</name>
		 <uri>http://www.flywe.net/</uri>
		 <email>fly_boy23@163.com</email>
	  </author>
	  <category term="" scheme="http://www.flywe.net/default.asp?cateID=7" label="JavaScript" /> 
	  <updated>2009-09-09T14:31:39+08:00</updated>
	  <published>2009-09-09T14:31:39+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><span style="color:Blue"><span style="font-size:14pt;line-height:100%;">:disabled</span></span></strong><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;匹配所有不可用元素。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回值：Array&lt;Element&gt;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;示例：<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;查找所有不可用的input元素。<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>HTML 代码:</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> &lt;form&gt;<br/>&nbsp;&nbsp;&lt;input name=&#34;email&#34; disabled=&#34;disabled&#34; /&gt;<br/>&nbsp;&nbsp;&lt;input name=&#34;id&#34; /&gt;<br/>&lt;/form&gt; </div></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>jQuery 代码:</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> $(&#34;input:disabled&#34;) </div></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>结果:</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> &lt;input name=&#34;email&#34; disabled=&#34;disabled&#34; /&gt; </div></div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.flywe.net/article/javascript/jQuery_disabled.html" /> 
	  <id>http://www.flywe.net/default.asp?id=875</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[jQuery帮助之选择器 表单对象属性 checked]]></title>
	  <author>
		 <name>flywe</name>
		 <uri>http://www.flywe.net/</uri>
		 <email>fly_boy23@163.com</email>
	  </author>
	  <category term="" scheme="http://www.flywe.net/default.asp?cateID=7" label="JavaScript" /> 
	  <updated>2009-09-08T15:28:54+08:00</updated>
	  <published>2009-09-08T15:28:54+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><span style="color:Blue"><span style="font-size:14pt;line-height:100%;">:checked</span></span></strong><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;匹配所有选中的被选中元素(复选框、单选框等，不包括sel&#101;ct中的option)。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回值：Array&lt;Element&gt;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;示例：<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;查找所有选中的复选框元素。<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>HTML 代码:</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> &lt;form&gt;<br/>&nbsp;&nbsp;&lt;input type=&#34;checkbox&#34; name=&#34;newsletter&#34; checked=&#34;checked&#34; value=&#34;Daily&#34; /&gt;<br/>&nbsp;&nbsp;&lt;input type=&#34;checkbox&#34; name=&#34;newsletter&#34; value=&#34;Weekly&#34; /&gt;<br/>&nbsp;&nbsp;&lt;input type=&#34;checkbox&#34; name=&#34;newsletter&#34; checked=&#34;checked&#34; value=&#34;Monthly&#34; /&gt;<br/>&lt;/form&gt; </div></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>jQuery 代码:</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> $(&#34;input:checked&#34;) </div></div><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>结果:</strong><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="UBBPanel codePanel"><div class="UBBTitle"><img src="http://www.flywe.net/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"> &lt;input type=&#34;checkbox&#34; name=&#34;newsletter&#34; checked=&#34;checked&#34; value=&#34;Daily&#34; /&gt;, &lt;input type=&#34;checkbox&#34; name=&#34;newsletter&#34; checked=&#34;checked&#34; value=&#34;Monthly&#34; /&gt; </div></div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.flywe.net/article/javascript/jQuery_checked.html" /> 
	  <id>http://www.flywe.net/default.asp?id=874</id>
  </entry>	
		
</feed>
