﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-王东校的Blog</title><link>http://www.blogjava.net/wdx821228/</link><description /><language>zh-cn</language><lastBuildDate>Sun, 12 Apr 2026 15:05:56 GMT</lastBuildDate><pubDate>Sun, 12 Apr 2026 15:05:56 GMT</pubDate><ttl>60</ttl><item><title>JQUERY 的AJAX只执行一次问题</title><link>http://www.blogjava.net/wdx821228/archive/2012/06/26/381510.html</link><dc:creator>王东校</dc:creator><author>王东校</author><pubDate>Tue, 26 Jun 2012 06:56:00 GMT</pubDate><guid>http://www.blogjava.net/wdx821228/archive/2012/06/26/381510.html</guid><wfw:comment>http://www.blogjava.net/wdx821228/comments/381510.html</wfw:comment><comments>http://www.blogjava.net/wdx821228/archive/2012/06/26/381510.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/wdx821228/comments/commentRss/381510.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wdx821228/services/trackbacks/381510.html</trackback:ping><description><![CDATA[<div>$.ajax({</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url: 'Ajax/OrderBy.aspx',</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data: {AppIds: sortedAppids},</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dataType: 'xml',</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type: 'POST',</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; success: function(xml)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alert("排序成功！");</div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; });</div><div></div><div>&nbsp;</div><div></div><div>ajax在同步交互时，第一次提交正常，再第二次提交如果和上次提交的url地址相同时将不进行提交，会用上次的返回值。这样处理也许是ext别有良苦用心，但是，如果遇到每次必须提交时，例如一次提交后台的数据已经被修改了，再次提交返回的结果其实是不一样的，这样就需要特殊处理了。</div><div></div><div>方法一：GET方式加参数</div><div></div><div>原代码：</div><div></div><div>&nbsp;</div><div>view plaincopy to clipboardprint?</div><div></div><div>&nbsp; &nbsp; var conn = Ext.lib.Ajax.getConnectionObject().conn; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conn.open("get", HOST+'/OrgUserAction_checkPassword.action?id='+id+'&amp;passwordOld='+checkValue,false); &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conn.send(null); &nbsp;&nbsp;</div><div>&nbsp; &nbsp; // &nbsp; &nbsp; &nbsp;alert(conn.responseText); &nbsp;</div><div></div><div>&nbsp;</div><div></div><div>&nbsp;</div><div></div><div>处理后</div><div></div><div>&nbsp;</div><div>view plaincopy to clipboardprint?</div><div></div><div>&nbsp; &nbsp; var conn = Ext.lib.Ajax.getConnectionObject().conn; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conn.open("get", HOST+'/OrgUserAction_checkPassword.action?id='+id+'&amp;passwordOld='+checkValue+'&amp;temp='+new Date(),false); &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conn.send(null); &nbsp;&nbsp;</div><div>&nbsp; &nbsp; // &nbsp; &nbsp; &nbsp;alert(conn.responseText); &nbsp;</div><div></div><div>&nbsp;</div><div></div><div>&nbsp;</div><div></div><div>添加了一个临时参数temp=new Date();</div><div></div><div>这样保证了每次提交的url是不同的，从而达到了每次都会提交的效果。</div><div></div><div>方法二：</div><div>把get 改成post就可以了type: 'POST',</div><img src ="http://www.blogjava.net/wdx821228/aggbug/381510.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wdx821228/" target="_blank">王东校</a> 2012-06-26 14:56 <a href="http://www.blogjava.net/wdx821228/archive/2012/06/26/381510.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>IE6下链接ONCLICK事件处理中的请求被ABORTED</title><link>http://www.blogjava.net/wdx821228/archive/2012/06/26/381509.html</link><dc:creator>王东校</dc:creator><author>王东校</author><pubDate>Tue, 26 Jun 2012 06:54:00 GMT</pubDate><guid>http://www.blogjava.net/wdx821228/archive/2012/06/26/381509.html</guid><wfw:comment>http://www.blogjava.net/wdx821228/comments/381509.html</wfw:comment><comments>http://www.blogjava.net/wdx821228/archive/2012/06/26/381509.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wdx821228/comments/commentRss/381509.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wdx821228/services/trackbacks/381509.html</trackback:ping><description><![CDATA[<div>一大早发现，ie6下点发起对话没法弹出窗口，ff浏览器就是可以的。开启HttpWatch检测，发现点击的被aborted。</div><div></div><div>查找资料显示aborted的原因如下。</div><div></div><div>The (Aborted) value is more complex in its origin. It occurs when IE has started to process the request for a URL (e.g. to download an image), but then decides to cancel the operation. Here are some examples of when this can occur:</div><div></div><div>If you click on a link or bookmark while a page is downloading, or click on IE&#8217;s Stop button, you will see that IE cancels any requests which are still active and HttpWatch shows the (Aborted) result.</div><div>A CSS rollover image on a page will start a request when the mouse pointer is moved into its active area. If the mouse pointer quickly moves away again, IE may abort the request if it has not already completed.</div><div>Sometimes javascript is used to fire off requests for background tasks or to gather statistics on a page. Often this can lead to aborted results if the javascript does not wait for the response to be received from the server.</div><div>继续寻找根源，搜索到发现这个问题是ie6中一个底层 机制的bug，之后的版本已经解决了。据说&lt;a href="javascript:void(0)"&gt;或者&lt;a href=#"&gt;这样使用a标签的话并不能阻止a标签最后触发一个什么行为，导致ie6会错误的认为页面刷新或者重定向了，并且中断了当前所有连 接，这样新的加载就被aborted了。解决方案最简单的方法有两个，一个是这样使用a标签&lt;a href="xxx(); return false;"&gt;，另外一个就是用div替换a标签来用。至此，问题总算解决。</div><div></div><div>在开发中常使用&lt;a&gt;标签代替button，好处在于可以利用a:hover样式做mouseover效果，但下面的代码在IE6下就有问题，onclick中的请求被aborted。</div><div>&lt;a href="javascript:void(0);" onclick="$('current').src='images/001.jpg';"&gt;切换图片&lt;/a&gt;，IE6下图片不显示。</div><div>&lt;a href="javascript:void(0);" onclick="MyJrjRelation.checkAttention();"&gt;关注此人&lt;/a&gt;，IE6下请求失败。</div><div></div><div>解决方法：</div><div>1. 不使用onclick，但必须保证处理函数不返回值，否则浏览器将清空页面，只显示函数的结果。如果checkAttention返回false，浏览器中就会显示false。</div><div>&lt;a href="javascript:MyJrjRelation.checkAttention();"&gt;关注此人&lt;/a&gt;</div><div></div><div>&lt;a href="javascript:void(MyJrjRelation.checkAttention());"&gt;关注此人&lt;/a&gt; &nbsp; void返回undefined；</div><div></div><div>2. 在onclick上加return false阻止浏览器执行href。href属性还是必须的，否则链接就样式失效了。</div><div>&lt;a href="javascript:void(0);" onclick="MyJrjRelation.checkAttention();return false;"&gt;关注此人&lt;/a&gt;</div><div></div><div>总结来说&lt;a href="javascript:void(0);" onclick="MyJrjRelation.checkAttention();return false;"&gt;的兼容性最好。</div><div></div><div>原文地址：</div><div>http://blog.csdn.net/wangjj_016/article/details/5304784</div><img src ="http://www.blogjava.net/wdx821228/aggbug/381509.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wdx821228/" target="_blank">王东校</a> 2012-06-26 14:54 <a href="http://www.blogjava.net/wdx821228/archive/2012/06/26/381509.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>钩子函数(Hook)</title><link>http://www.blogjava.net/wdx821228/archive/2010/02/02/311691.html</link><dc:creator>王东校</dc:creator><author>王东校</author><pubDate>Tue, 02 Feb 2010 08:08:00 GMT</pubDate><guid>http://www.blogjava.net/wdx821228/archive/2010/02/02/311691.html</guid><wfw:comment>http://www.blogjava.net/wdx821228/comments/311691.html</wfw:comment><comments>http://www.blogjava.net/wdx821228/archive/2010/02/02/311691.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wdx821228/comments/commentRss/311691.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wdx821228/services/trackbacks/311691.html</trackback:ping><description><![CDATA[钩子函数是Windows系统自带的函数，是非常重要的系统接口函数，利用钩子函数，它可以捕捉当前进程或其他进程发生的消息。通过&#8220;钩挂&#8221;，你可以给WINDOWS一个处理或过滤事件的回调函数，该函数也叫做&#8220;钩子函数&#8221;，当每次发生你感兴趣的事件时，WINDOWS都将调用该函数。简单的说钩子函数就是Windows系统自带的&#8220;监工&#8221;&#8220;监视者&#8221;，它们负责监视系统内各个进程的运行状况，并从中获得数据，比如获得鼠标激活、键盘响应等信息，系统正是根据钩子函数对该信息作出的处理。典型的一个应用就是金山词霸的屏幕抓词，他就是利用了<strong>钩子函数</strong>捕捉鼠标事件从而及时的对鼠标所指向的词汇进行翻译。
<p>&nbsp;&nbsp;&nbsp;&nbsp; 当然钩子函数具有如此厉害的功能，肯定也受黑客和木马编写者的青睐。试想一下：当木马利用钩子函数监控并收集你在键盘上敲击的每一个按键并发送给黑客这是怎么样的后果？你还敢在电脑上输银行账户和密码？输入QQ或网游帐号？当然不敢因为你在电脑上的一举一动都在被木马程序所监控所记录，你的隐私也不会得到保障。钩子函数也是诸如《键盘记录器》这样软件的主要组成部分。</p>
 <img src ="http://www.blogjava.net/wdx821228/aggbug/311691.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wdx821228/" target="_blank">王东校</a> 2010-02-02 16:08 <a href="http://www.blogjava.net/wdx821228/archive/2010/02/02/311691.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>