<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>O!Hacker Blog &#187; Javascript</title>
	<atom:link href="http://ohacker.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://ohacker.com</link>
	<description>anything to hack</description>
	<lastBuildDate>Thu, 12 Aug 2010 05:17:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>JavaScript 拖拽原理</title>
		<link>http://ohacker.com/2010/02/07/javascript-drag-drop/</link>
		<comments>http://ohacker.com/2010/02/07/javascript-drag-drop/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 14:38:03 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[drag&drop]]></category>

		<guid isPermaLink="false">http://ohacker.com/2010/02/07/javascript-%e6%8b%96%e6%8b%bd%e5%8e%9f%e7%90%86/</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160;&#160; javascript drag&#38;drop beginning 首先我不赞成自己实现拖拽功能，因为比较麻烦， 建议用当下比较流行的一些库，用什么那就看项目需要了， 但是即便用别人的东西也只至少知道原理，所以我们先看看原理吧 如果想自己手动实现拖拽，那么我们先看看都要有哪些工作要做。 1 至少要获得鼠标的坐标吧，不然还干个屁。 2 至少要获得鼠标的动作吧，不然我怎么知道什么时候拖。什么时候停 3 在页面上拖动一个目标实际上就是，改变某个标签的坐标，当然一般也要适当改变 也些样式。所以你至少要知道一些css方面的知识。 1 鼠标坐标： function mouseCoords&#40;ev&#41;&#123; if &#40;ev.pageX &#124;&#124; ev.pageY&#41; &#123; return &#123; x: ev.pageX, y: ev.pageY &#125;; &#125; return &#123; x: ev.clientX + document.body.scrollLeft - document.body.clientLeft, y: ev.clientY + document.body.scrollTop - document.body.clientTop &#125;; &#125; 唯一要解释的就是型参ev：ev实际就是windows.even: 调用这个函数： document.onmousemove = mouseMove; function mouseMove&#40;ev&#41;&#123; [...]]]></description>
		<wfw:commentRss>http://ohacker.com/2010/02/07/javascript-drag-drop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JS切割图片利器&#8211;JQuery Jcrop</title>
		<link>http://ohacker.com/2009/09/21/js-jquery-jcrop/</link>
		<comments>http://ohacker.com/2009/09/21/js-jquery-jcrop/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 21:25:28 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Jcrop]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://localhost/blog/?p=64</guid>
		<description><![CDATA[什么都不说了，上代码： $.Jcrop&#40;&#34;#cropbox&#34;,&#123; aspectRatio:cropAspect,//切割时的长宽比例 onSelect:funciton1,//select的事件回调函数 boxWidth:200, boxHeight:200, onChange:function2//切割时的事件处理 &#125; &#60;img align=&#34;center&#34; id=&#34;cropbox&#34; src=&#34;&#34; alt=&#34;&#34;/&#62; &#60;input id=&#34;imageX&#34; name=&#34;imageX&#34; value=&#34;0&#34; type=&#34;hidden&#34; /&#62; &#60;input id=&#34;imageY&#34; name=&#34;imageY&#34; value=&#34;0&#34; type=&#34;hidden&#34; /&#62; &#60;input id=&#34;imageWidth&#34; name=&#34;imageWidth&#34; value=&#34;0&#34; type=&#34;hidden&#34; /&#62; &#60;input id=&#34;imageHeight&#34; name=&#34;imageHeight&#34; value=&#34;0&#34; type=&#34;hidden&#34; /&#62; 相关日志JQuery 上传文件的插件 uploadify]]></description>
		<wfw:commentRss>http://ohacker.com/2009/09/21/js-jquery-jcrop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JQuery 上传文件的插件 uploadify</title>
		<link>http://ohacker.com/2009/08/07/js-jquery-uploadify/</link>
		<comments>http://ohacker.com/2009/08/07/js-jquery-uploadify/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 14:03:33 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Uploadify]]></category>

		<guid isPermaLink="false">http://localhost/blog/?p=60</guid>
		<description><![CDATA[jquery plugin uploadify]]></description>
		<wfw:commentRss>http://ohacker.com/2009/08/07/js-jquery-uploadify/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在Ext GridPanel中设置某一列不参与分组的办法</title>
		<link>http://ohacker.com/2009/07/28/%e5%9c%a8ext-gridpanel%e4%b8%ad%e8%ae%be%e7%bd%ae%e6%9f%90%e4%b8%80%e5%88%97%e4%b8%8d%e5%8f%82%e4%b8%8e%e5%88%86%e7%bb%84%e7%9a%84%e5%8a%9e%e6%b3%95/</link>
		<comments>http://ohacker.com/2009/07/28/%e5%9c%a8ext-gridpanel%e4%b8%ad%e8%ae%be%e7%bd%ae%e6%9f%90%e4%b8%80%e5%88%97%e4%b8%8d%e5%8f%82%e4%b8%8e%e5%88%86%e7%bb%84%e7%9a%84%e5%8a%9e%e6%b3%95/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 16:42:01 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Extjs]]></category>

		<guid isPermaLink="false">http://localhost/blog/?p=18</guid>
		<description><![CDATA[假设你已经有一个包含分组的Grid，在其设置column的地方设置属性groupable：false。 见代码： &#123; id: 'cost', header: &#34;Cost&#34;, width: 20, sortable: false, groupable: false, dataIndex: 'cost', summaryType:'totalCost', summaryRenderer: Ext.util.Format.usMoney &#125; 相关日志暂无相关日志]]></description>
		<wfw:commentRss>http://ohacker.com/2009/07/28/%e5%9c%a8ext-gridpanel%e4%b8%ad%e8%ae%be%e7%bd%ae%e6%9f%90%e4%b8%80%e5%88%97%e4%b8%8d%e5%8f%82%e4%b8%8e%e5%88%86%e7%bb%84%e7%9a%84%e5%8a%9e%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>正则表达式验证邮箱地址</title>
		<link>http://ohacker.com/2009/04/28/%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e9%aa%8c%e8%af%81%e9%82%ae%e7%ae%b1%e5%9c%b0%e5%9d%80/</link>
		<comments>http://ohacker.com/2009/04/28/%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e9%aa%8c%e8%af%81%e9%82%ae%e7%ae%b1%e5%9c%b0%e5%9d%80/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 16:08:00 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ohacker.com/2009/04/28/%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e9%aa%8c%e8%af%81%e9%82%ae%e7%ae%b1%e5%9c%b0%e5%9d%80/</guid>
		<description><![CDATA[定义以下模式为有效的： john@hotmail.com john.doe@somewhere.com John Doe&#60;john.doe@somewhere.com&#62; javascript的正则表达式为var reEmail=/^(?:\w+\.?)*\w+@(?:\w+\.?)*\w+$/; 相关日志暂无相关日志]]></description>
		<wfw:commentRss>http://ohacker.com/2009/04/28/%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e9%aa%8c%e8%af%81%e9%82%ae%e7%ae%b1%e5%9c%b0%e5%9d%80/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在ExtJs应用中快速为页面元素添加tooltip</title>
		<link>http://ohacker.com/2009/04/24/%e5%9c%a8extjs%e5%ba%94%e7%94%a8%e4%b8%ad%e5%bf%ab%e9%80%9f%e4%b8%ba%e9%a1%b5%e9%9d%a2%e5%85%83%e7%b4%a0%e6%b7%bb%e5%8a%a0tooltip/</link>
		<comments>http://ohacker.com/2009/04/24/%e5%9c%a8extjs%e5%ba%94%e7%94%a8%e4%b8%ad%e5%bf%ab%e9%80%9f%e4%b8%ba%e9%a1%b5%e9%9d%a2%e5%85%83%e7%b4%a0%e6%b7%bb%e5%8a%a0tooltip/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 09:08:00 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ohacker.com/2009/04/24/%e5%9c%a8extjs%e5%ba%94%e7%94%a8%e4%b8%ad%e5%bf%ab%e9%80%9f%e4%b8%ba%e9%a1%b5%e9%9d%a2%e5%85%83%e7%b4%a0%e6%b7%bb%e5%8a%a0tooltip/</guid>
		<description><![CDATA[ExtJs是通过Ext.ToolTip和Ext.QuickTips两个组件来实现浮动提示功能的。 QuickTips代码示例：只需要加入Ext.QuickTips.init(); 就可以在html页面中使用。html页面 可以通过：&#60;input type="button" value="OK" ext:qtitle="Test" ext:qtip="Test Content!"&#62; 相关日志暂无相关日志]]></description>
		<wfw:commentRss>http://ohacker.com/2009/04/24/%e5%9c%a8extjs%e5%ba%94%e7%94%a8%e4%b8%ad%e5%bf%ab%e9%80%9f%e4%b8%ba%e9%a1%b5%e9%9d%a2%e5%85%83%e7%b4%a0%e6%b7%bb%e5%8a%a0tooltip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript方式打开一个浏览器</title>
		<link>http://ohacker.com/2009/04/23/javascript-open-new-window/</link>
		<comments>http://ohacker.com/2009/04/23/javascript-open-new-window/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 05:20:00 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ohacker.com/2009/04/23/javascript%e6%96%b9%e5%bc%8f%e6%89%93%e5%bc%80%e4%b8%80%e4%b8%aa%e6%b5%8f%e8%a7%88%e5%99%a8/</guid>
		<description><![CDATA[var newWindow =window.open&#40; url, 'txtPopup', 'height=768,location=0,menubar=0,personalbar=0,scrollbars=1,status=0,toolbar=0,width=1024,resizable=0' &#41;; newWindow.focus&#40;&#41;; javascript 刷新页面的方式： history.go(0) location.reload() location=location location.assign(location) document.execCommand(&#8216;Refresh&#8217;) window.navigate(location) location.replace(location) document.URL=location.href 相关日志暂无相关日志]]></description>
		<wfw:commentRss>http://ohacker.com/2009/04/23/javascript-open-new-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ext.TabPanel遇到的问题与解决方法</title>
		<link>http://ohacker.com/2009/04/17/ext-tabpanel%e9%81%87%e5%88%b0%e7%9a%84%e9%97%ae%e9%a2%98%e4%b8%8e%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/</link>
		<comments>http://ohacker.com/2009/04/17/ext-tabpanel%e9%81%87%e5%88%b0%e7%9a%84%e9%97%ae%e9%a2%98%e4%b8%8e%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 07:44:00 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ohacker.com/2009/04/17/ext-tabpanel%e9%81%87%e5%88%b0%e7%9a%84%e9%97%ae%e9%a2%98%e4%b8%8e%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/</guid>
		<description><![CDATA[今天在Ext.form.FormPanel中嵌套TabPanel时，发现了这样一个问题：创建了一个FormPanel，在这个Panel中需要以Tab的方式展现数据，每个TabPanel中包含一个FormPanel的字段。但是我发现在每次FormPaneel中的数据load完成之后，只有处于Active状态的Tab中的数据存在，而Active其他Tab后，数据都看不见，所以我怀疑是BasicForm装载数据的时候，这些处于非active状态的panel并没有创建出来。解决办法：在FormPanel中的Form装载完数据后，把这些出具备份到这个BasicForm中的一个属性中，比如result_data。之后在TabPanel的这些Field渲染的时候，判断result_data是否存在，如果存在，则把对应的字段值填进去。示例代码：//监听basicForm中的数据加载完成new Ext.FormPanel({ listeners:{ actioncomplete:function(form,action){ if(action.type=="load"){ form.result_data=action.result.data } } }......//formPanel中嵌套的tabPanel{ xtype:'tabpanel', activeTab: 0, items : [{ title : track_window.column.text_what_has_been_done, height : 180, layout:'fit', items:{//tabPanel中所包含的Form的字段 xtype : 'htmleditor', name : 'progress_log_desc[has_done]', autoScroll: true, listeners:{//监听此字段的render事件 render:function(he){ var data=Ext.getCmp('_mng_task_track_win_form_').getForm().result_data if(data!=null&#038;&#038;data!=undefined){ he.setValue(data["progress_log_desc[has_done]"]) } } } } }, { title : track_window.column.text_what_impedes, height : 180, layout:'fit', items:{ xtype : 'htmleditor', name [...]]]></description>
		<wfw:commentRss>http://ohacker.com/2009/04/17/ext-tabpanel%e9%81%87%e5%88%b0%e7%9a%84%e9%97%ae%e9%a2%98%e4%b8%8e%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何获取Ext.form.FormPanel的load和submit事件</title>
		<link>http://ohacker.com/2009/04/15/%e5%a6%82%e4%bd%95%e8%8e%b7%e5%8f%96ext-form-formpanel%e7%9a%84load%e5%92%8csubmit%e4%ba%8b%e4%bb%b6/</link>
		<comments>http://ohacker.com/2009/04/15/%e5%a6%82%e4%bd%95%e8%8e%b7%e5%8f%96ext-form-formpanel%e7%9a%84load%e5%92%8csubmit%e4%ba%8b%e4%bb%b6/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 06:41:00 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ohacker.com/2009/04/15/%e5%a6%82%e4%bd%95%e8%8e%b7%e5%8f%96ext-form-formpanel%e7%9a%84load%e5%92%8csubmit%e4%ba%8b%e4%bb%b6/</guid>
		<description><![CDATA[在使用ExtJs.form.FormPanel的过程中，有很多时候需要获得装载数据完成时的事件，那么一般这种事件怎么获得呢？请看如下示例： Ext.getCmp('tabs').getForm().on("actioncomplete",function(from,action){if(action.type=="submit"){console.log(action.result)}})其中Ext.getCmp('tabs')是假设有一个id=‘tabs’的FormPanel。而action.type就是指事件（action）的类型。目前有两种分别为&#8217;submit&#8217;和&#8217;load&#8217;。 相关日志暂无相关日志]]></description>
		<wfw:commentRss>http://ohacker.com/2009/04/15/%e5%a6%82%e4%bd%95%e8%8e%b7%e5%8f%96ext-form-formpanel%e7%9a%84load%e5%92%8csubmit%e4%ba%8b%e4%bb%b6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ext.Window 问题总结</title>
		<link>http://ohacker.com/2009/04/15/ext-window-%e9%97%ae%e9%a2%98%e6%80%bb%e7%bb%93/</link>
		<comments>http://ohacker.com/2009/04/15/ext-window-%e9%97%ae%e9%a2%98%e6%80%bb%e7%bb%93/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 08:18:00 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ohacker.com/2009/04/15/ext-window-%e9%97%ae%e9%a2%98%e6%80%bb%e7%bb%93/</guid>
		<description><![CDATA[Ext.Window 是Ext中最漂亮的widgets之一。但是在实际开发中问题多多。关于隐藏： 问题：作为一个重量级widgets，为了减少资源的消耗，每当关闭时，window默认为隐藏模式，可是每次你再打开这个window的时候，会发现window中的数据（我的习惯是在window中嵌套formPanel，我所指的数据是formPanel中的数据）可能并没有变，或者说更新。其中大部分原因，要么是formPanel没有load数据，要么是window初始化的时候把某个数据传给了某个监听器或者handler，而再次打开window的时候，数据并没有传过去。 办法1：这种办法就是不用隐藏，每次都打开，在关闭window的监听器中，或者关闭window的时候distroy这个对象，记住在这之前一定要把这个window中引用到的其他对象也要distroy掉，之后在把它们的引用设为null。办法比较土，但是管事，好使。这样做一定记住设置closeAction：&#8217;close&#8217; 办法2 不distroy任何对象，把一种办法中出现混淆的变量以参数的形式传给handler。在这里一定要关注的是嵌套在windows中的formpanel中的隐藏域，load数据的时候一定要保证所有的field都是load出来的。最后加一个mask，保证load的完整性。closeAction：&#8217;hide&#8217;。 相关日志暂无相关日志]]></description>
		<wfw:commentRss>http://ohacker.com/2009/04/15/ext-window-%e9%97%ae%e9%a2%98%e6%80%bb%e7%bb%93/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
