<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[怎么将这个div显示或隐藏掉？]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[代码编程]]></category>
<pubDate>Wed, 27 Sep 2006 03:01:10 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	问：<br/>我在执行数据库查询时，因为数据量大，所以在执行查询的过程中，显示一个div告知用户“正在查询，请稍后。。。”，当查询完毕，将这个div隐藏掉。我该怎么做？ <br/><br/>答：<br/>查询数据库是服务器的事，查询之前，执行 &nbsp; <br/> &nbsp;&lt;script &nbsp; language=&#039;jscript&#039;&gt; &nbsp; <br/> &nbsp;document.all.oDiv.style.display &nbsp; = &nbsp; &#039;none&#039;; &nbsp; <br/> &nbsp;&lt;/script&gt; &nbsp; <br/> &nbsp;是把脚本写的客户端，服务器服开始执行查询，完了以后，又执行各户端的脚本，当然就是上面的情况了 &nbsp; <br/> &nbsp;解决这个问题 &nbsp; <br/> &nbsp;1.要在客户端写脚本，当点击查询之前就让其显示出来 &nbsp; <br/> &nbsp;&lt;script &nbsp; language=&#039;jscript&#039;&gt; &nbsp; <br/> &nbsp;function &nbsp; ShowDiv() &nbsp; <br/> &nbsp;{ &nbsp; <br/> &nbsp; &nbsp; &nbsp; &nbsp;//让你的Div显示 &nbsp; <br/> &nbsp;} &nbsp; <br/> &nbsp;&lt;/script&gt; &nbsp; <br/> &nbsp;比如你的查询按钮是服务器端的叫Button &nbsp; <br/> &nbsp;可以在pageload里加上Button.attributes.add(&quot;onclick&quot;,&quot;ShowDiv()&quot;); &nbsp; <br/> &nbsp;在Button_cliclk()里再写 &nbsp; <br/> &nbsp;Response.Write(&quot;&lt;div &nbsp; id=&#039;oDiv&#039;&gt;正在查询，请稍后。。。&lt;/div&gt;&quot;); &nbsp; <br/> &nbsp;Response.Flush(); &nbsp; <br/> &nbsp;// &nbsp; 执行查询语句以及其他的操作 &nbsp; <br/> &nbsp; &nbsp;<br/> &nbsp;然后在代码的最后用角本把 &nbsp; oDiv &nbsp; 隐藏 &nbsp; <br/> &nbsp;&lt;script &nbsp; language=&#039;jscript&#039;&gt; &nbsp; <br/> &nbsp;document.all.oDiv.style.display &nbsp; = &nbsp; &#039;none&#039;; &nbsp; <br/> &nbsp;&lt;/script&gt;应该可以了 &nbsp; <br/> &nbsp; &nbsp;<br/>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] 怎么将这个div显示或隐藏掉？]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>