<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7824916714311268121</id><updated>2011-05-28T23:20:09.965-04:00</updated><title type='text'>CFDev</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vraajkumar.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7824916714311268121/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://vraajkumar.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Raj</name><uri>http://www.blogger.com/profile/01751809213128404235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7824916714311268121.post-4676585915065721994</id><published>2009-02-21T06:03:00.002-05:00</published><updated>2009-02-21T06:25:58.476-05:00</updated><title type='text'>jQuery's Trigger function</title><content type='html'>I found out about the trigger function in jQuery a while back and I love it. Using this we have the ability to "trigger" an event on all the matched element. &lt;div&gt;For example, if there is an event-hander for a click event like this,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;$("#testButton").click(&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;function(){&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;console.log("inside testButton click");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;);&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;We can use the following code to execute the above event handler as if the click event happened (almost) in the browser.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;$("#testButton").trigger("click");&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The one cavet is if you trigger an event which uses the position (x,y coordinates) or keycode (enter key etc.,) you may get error, since those are not passed when using the trigger function.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7824916714311268121-4676585915065721994?l=vraajkumar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vraajkumar.blogspot.com/feeds/4676585915065721994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7824916714311268121&amp;postID=4676585915065721994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7824916714311268121/posts/default/4676585915065721994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7824916714311268121/posts/default/4676585915065721994'/><link rel='alternate' type='text/html' href='http://vraajkumar.blogspot.com/2009/02/jquerys-trigger-function.html' title='jQuery&apos;s Trigger function'/><author><name>Raj</name><uri>http://www.blogger.com/profile/01751809213128404235</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
