<?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-6227614017686439825</id><updated>2011-07-08T02:52:37.204-07:00</updated><category term='Selectors'/><category term='irc'/><category term='#jQuery'/><category term='Paul Irish'/><category term='best practice'/><category term='anti-pattern'/><title type='text'>Kambfhases Blög</title><subtitle type='html'>This is my blog, if you do not like it: Tits or GTFO!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kambfhase.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kambfhase.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Kambfhase</name><uri>http://www.blogger.com/profile/05582566388912356628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_5rEdSMoHw-o/S3HBXUCMz5I/AAAAAAAAAAM/DC5Na_KbgM8/s1600-R/3394a3d688d637202e69f7676295dd0f.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6227614017686439825.post-464921981774552925</id><published>2010-06-02T03:51:00.000-07:00</published><updated>2010-06-02T03:54:44.820-07:00</updated><title type='text'>Using Objects Maps</title><content type='html'>Say you have a lot of variables a1,a2, ... an and have a number x=5 to select the ax variable.&lt;br /&gt;&lt;br /&gt;using Objects as a map you can do this quite easily:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;var obj = {&lt;br /&gt;    a1 = a1,&lt;br /&gt;    a2 = a2,&lt;br /&gt;&lt;br /&gt;    an = an&lt;br /&gt;};&lt;br /&gt;var chosen = obj["a"+x];&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now chosen contains the ax variable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6227614017686439825-464921981774552925?l=kambfhase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kambfhase.blogspot.com/feeds/464921981774552925/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://kambfhase.blogspot.com/2010/06/using-objects-maps.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/464921981774552925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/464921981774552925'/><link rel='alternate' type='text/html' href='http://kambfhase.blogspot.com/2010/06/using-objects-maps.html' title='Using Objects Maps'/><author><name>Kambfhase</name><uri>http://www.blogger.com/profile/05582566388912356628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_5rEdSMoHw-o/S3HBXUCMz5I/AAAAAAAAAAM/DC5Na_KbgM8/s1600-R/3394a3d688d637202e69f7676295dd0f.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6227614017686439825.post-7659752187417479598</id><published>2010-05-24T05:07:00.002-07:00</published><updated>2010-05-24T05:13:51.552-07:00</updated><title type='text'>Pitfall</title><content type='html'>This is an easy pitfall to make:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&lt;br /&gt;(function(){&lt;br /&gt;var Object = Object;&lt;br /&gt;&lt;br /&gt;})();&lt;br /&gt;&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;Object ends up undefined. So, a fix for that would be:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&lt;br /&gt;(function(){&lt;br /&gt;Var Object = window.Object;&lt;br /&gt;&lt;br /&gt;})();&lt;br /&gt;&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;But it is slower than this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&lt;br /&gt;(function(){&lt;br /&gt;var O = Object;&lt;br /&gt;&lt;br /&gt;})();&lt;br /&gt;&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;another obvious working Pattern is&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&lt;br /&gt;(function(Object){&lt;br /&gt;&lt;br /&gt;})(Object);&lt;br /&gt;&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;MfG Kambfhase&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6227614017686439825-7659752187417479598?l=kambfhase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kambfhase.blogspot.com/feeds/7659752187417479598/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://kambfhase.blogspot.com/2010/05/pitfall.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/7659752187417479598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/7659752187417479598'/><link rel='alternate' type='text/html' href='http://kambfhase.blogspot.com/2010/05/pitfall.html' title='Pitfall'/><author><name>Kambfhase</name><uri>http://www.blogger.com/profile/05582566388912356628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_5rEdSMoHw-o/S3HBXUCMz5I/AAAAAAAAAAM/DC5Na_KbgM8/s1600-R/3394a3d688d637202e69f7676295dd0f.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6227614017686439825.post-1157339241123743505</id><published>2010-03-04T01:45:00.000-08:00</published><updated>2010-03-15T08:48:19.688-07:00</updated><title type='text'>jQuery: Selecting by ID</title><content type='html'>&lt;pre&gt;&lt;code&gt;&amp;lt;div id="randomid" &amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;You can make jQuery faster by giving it less information about the element you want to select. In Version 1.4+ jQuery optimizes the selecting logic so that $('#randomid') is super fast. So do not do this:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;$('div#randomid') // IDs are unique, so the div is unnecessary&lt;br /&gt;$('div[id="randomid"]') // #id is faster&lt;br /&gt;$('body #randomid') // slower, since we have to find body first&lt;br /&gt;$('#randomid',context) // the context makes jQuery use Sizzle, which is slow!&lt;br /&gt;$('#context #randomid') // see above&lt;br /&gt;$('#context').find('#randomid') // Hell, no!&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;So stick with the nice and simple:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;$('#randomid')&lt;span style="font-family:Georgia,serif;"&gt;.do(something)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;MfG Hase&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6227614017686439825-1157339241123743505?l=kambfhase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kambfhase.blogspot.com/feeds/1157339241123743505/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://kambfhase.blogspot.com/2010/03/jquery-selecting-by-id.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/1157339241123743505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/1157339241123743505'/><link rel='alternate' type='text/html' href='http://kambfhase.blogspot.com/2010/03/jquery-selecting-by-id.html' title='jQuery: Selecting by ID'/><author><name>Kambfhase</name><uri>http://www.blogger.com/profile/05582566388912356628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_5rEdSMoHw-o/S3HBXUCMz5I/AAAAAAAAAAM/DC5Na_KbgM8/s1600-R/3394a3d688d637202e69f7676295dd0f.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6227614017686439825.post-2464510062606936230</id><published>2010-02-22T10:36:00.000-08:00</published><updated>2010-02-25T07:20:09.559-08:00</updated><title type='text'>jQuery 1.4 for Greasemonkey</title><content type='html'>For some random reason jQuery 1.4 no longer works with Greasemonkey. But the fix is trivial. Either use &lt;a href="http://kampfhase2005.ka.funpic.de/uploads/GM_jquery.js"&gt;this fixed 1.4.2 version&lt;/a&gt; with @require, or do it your self: Simply replace the &lt;span style="font-style: italic;"&gt;window&lt;/span&gt; at the very end of the jQuery source code with &lt;span style="font-style: italic;"&gt;unsafeWindow&lt;/span&gt;. You might also want to add this line to the beginning of your GM Script:&lt;br /&gt;&lt;br /&gt;var $=unsafeWindow.jQuery;&lt;br /&gt;&lt;br /&gt;Keep on scripting!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mfG Kambfhase&lt;br /&gt;&lt;br /&gt;edit: Either I am to stupid or jQuery is not capable of triggering events out of GM. Or probably both.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6227614017686439825-2464510062606936230?l=kambfhase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kambfhase.blogspot.com/feeds/2464510062606936230/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://kambfhase.blogspot.com/2010/02/jquery-14-for-greasemonkey.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/2464510062606936230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/2464510062606936230'/><link rel='alternate' type='text/html' href='http://kambfhase.blogspot.com/2010/02/jquery-14-for-greasemonkey.html' title='jQuery 1.4 for Greasemonkey'/><author><name>Kambfhase</name><uri>http://www.blogger.com/profile/05582566388912356628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_5rEdSMoHw-o/S3HBXUCMz5I/AAAAAAAAAAM/DC5Na_KbgM8/s1600-R/3394a3d688d637202e69f7676295dd0f.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6227614017686439825.post-4737420252436211970</id><published>2010-02-16T04:10:00.000-08:00</published><updated>2010-02-16T05:19:32.104-08:00</updated><title type='text'>Clickmaps for jQuery</title><content type='html'>I hereby release my very first jQuery plugin called Clickmap.&lt;br /&gt;&lt;br /&gt;As the name implies, it captures (nearly) all clicks on the page. This data then is used to create a map on top of the page using canvas that shows the points the user clicks. The canvas is also transparent and does not can be clicked in Firefox 3.6 ( probably also in Webkit). The click simply goes through it.&lt;br /&gt;&lt;br /&gt;This is what the clickmap looks like:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.abload.de/image.php?img=clickmap1xit.png"&gt;&lt;img src="http://www.abload.de/thumb/clickmap1xit.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How to install/ use:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Include the &lt;a href="http://kampfhase2005.ka.funpic.de/uploads/clickmap.js"&gt;source code&lt;/a&gt; into your project. To display the clickmap call jQuery.clickmap.draw() . Also, jQuery.clickmap.clicks is an array containing all the click data, so you can send that to your server and do further investigation there. You can even decide what should be captured. Look at the code for more infos.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Important Notice:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Clickmaps only includes clicks that bubble all the way up to document.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So if you have problems, issues or complaints comments or send me a mail. If you know how to find out, whether the browser supports pointer-events please tell me!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MfG Kambfhase&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6227614017686439825-4737420252436211970?l=kambfhase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kambfhase.blogspot.com/feeds/4737420252436211970/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://kambfhase.blogspot.com/2010/02/clickmaps-for-jquery.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/4737420252436211970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/4737420252436211970'/><link rel='alternate' type='text/html' href='http://kambfhase.blogspot.com/2010/02/clickmaps-for-jquery.html' title='Clickmaps for jQuery'/><author><name>Kambfhase</name><uri>http://www.blogger.com/profile/05582566388912356628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_5rEdSMoHw-o/S3HBXUCMz5I/AAAAAAAAAAM/DC5Na_KbgM8/s1600-R/3394a3d688d637202e69f7676295dd0f.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6227614017686439825.post-5335239130190731128</id><published>2010-02-12T04:37:00.000-08:00</published><updated>2010-02-12T04:51:36.386-08:00</updated><title type='text'>Console.log() vs. Alert()</title><content type='html'>Why do people still use alert()? It's annoying, can only display strings properly, [object Object] is useless. It stops the execution of the script and it needs you to click ok. Why not use console.log instead? Console.log is supported across all modern Browsers, including IE8!&lt;br /&gt;&lt;br /&gt;"But my script will break in IE6 if I use console.log"&lt;br /&gt;&lt;br /&gt;Dude, it takes 5 lines of JavaScript to fix that problem and you don't want the user to be annoyed by cryptic debugging Information, do you?&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;if( !window.console){&lt;br /&gt;      window.console = {&lt;br /&gt;              log: window.alert&lt;br /&gt;      };&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This is not even difficult pro-technique js. Personally I prefer:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;var cl = window.console ? console.log : function(){};&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Every time you use alert(), God kills a kitten!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mfG Kambfhase&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6227614017686439825-5335239130190731128?l=kambfhase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kambfhase.blogspot.com/feeds/5335239130190731128/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://kambfhase.blogspot.com/2010/02/consolelog-vs-alert.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/5335239130190731128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/5335239130190731128'/><link rel='alternate' type='text/html' href='http://kambfhase.blogspot.com/2010/02/consolelog-vs-alert.html' title='Console.log() vs. Alert()'/><author><name>Kambfhase</name><uri>http://www.blogger.com/profile/05582566388912356628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_5rEdSMoHw-o/S3HBXUCMz5I/AAAAAAAAAAM/DC5Na_KbgM8/s1600-R/3394a3d688d637202e69f7676295dd0f.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6227614017686439825.post-2703645580492231502</id><published>2010-02-11T10:53:00.000-08:00</published><updated>2010-02-11T12:35:22.824-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='anti-pattern'/><category scheme='http://www.blogger.com/atom/ns#' term='best practice'/><title type='text'>The Bitwise Not Operator aka. ~</title><content type='html'>I often have seen code like this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;pre&gt;Array.prototype.inArray = function(arg){&lt;br /&gt; return !!~this.indexOf(arg);&lt;br /&gt;};&lt;/pre&gt;&lt;br /&gt;Let's assume this piece of code would be C++. this.indexOf(arg) would then return an integer which is the index of arg if arg is in the array, else it will return -1; Since most CPUs use the &lt;a href="http://en.wikipedia.org/wiki/Two%27s_complement"&gt;two's complement&lt;/a&gt; the -1 would be represented by 0xFF. All the other indices will be simple binary numbers. The ~ operator flips all bits. So -1 will then be 0x00 where as the other numbers will become something else. The first ! turns the 0x00 into a true and the rest into a false. The last ! swaps that again. So we started with a -1 end ended with a false. A 3 would be converted to true. The sole reason C++ programmers use the ~ instead of &gt;= 0 is to save a few nanoseconds. Flipping bits is slightly faster than a comparison.&lt;br /&gt;&lt;br /&gt;But this is not C++ its JS. JS has no integer values. All numbers are of the type best known as &lt;a href="http://en.wikipedia.org/wiki/IEEE_754-1985#Double-precision_64_bit"&gt;double&lt;/a&gt;. But that is a difficult standard and since JS was supposed to be easy ~ does not flip the bits in the 64-Bit floating point representation. Instead the number is converted to a 32-bit signed integer in two's complement. Than the bits are inverted. Afterwards it gets converted backwards.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You see that the ~ operator does things slower than expected. Do not use it. It only makes you look rather stupid.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mfG Kambfhase&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6227614017686439825-2703645580492231502?l=kambfhase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kambfhase.blogspot.com/feeds/2703645580492231502/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://kambfhase.blogspot.com/2010/02/operator.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/2703645580492231502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/2703645580492231502'/><link rel='alternate' type='text/html' href='http://kambfhase.blogspot.com/2010/02/operator.html' title='The Bitwise Not Operator aka. ~'/><author><name>Kambfhase</name><uri>http://www.blogger.com/profile/05582566388912356628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_5rEdSMoHw-o/S3HBXUCMz5I/AAAAAAAAAAM/DC5Na_KbgM8/s1600-R/3394a3d688d637202e69f7676295dd0f.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6227614017686439825.post-8769604745655608343</id><published>2010-02-10T02:27:00.000-08:00</published><updated>2010-02-10T03:17:26.593-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='irc'/><category scheme='http://www.blogger.com/atom/ns#' term='Paul Irish'/><category scheme='http://www.blogger.com/atom/ns#' term='#jQuery'/><category scheme='http://www.blogger.com/atom/ns#' term='Selectors'/><title type='text'>Scientific Research proves: Paul Irish is human!</title><content type='html'>Note: This is not about a &lt;a href="http://en.wikipedia.org/wiki/Turing_test"&gt;turing test&lt;/a&gt; with Paul.&lt;br /&gt;&lt;br /&gt;Last week I have have been on &lt;a href="irc://irc.freenode.net/#jQuery"&gt;irc://irc.freenode.net/#jQuery&lt;/a&gt; to ask for an advice:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;khase&gt;       &amp;lt;khase&amp;gt;     Best Practice Question: I currently add a custom enabled-attribute to a couple of spans. I preserve classes to be for styling only, as the enabled attr, is used for more things than just layout. Is one method faster/better than the other or is it just amatter of taste?&lt;br /&gt;&amp;lt;thelaings&amp;gt;    hey ppl&lt;br /&gt;&amp;lt;timmywil&amp;gt;    khase: which method are you using?&lt;br /&gt;&amp;lt;erichynds&amp;gt;    khase: creating custom attributes can cause memory leaks&lt;br /&gt;&amp;lt;khase&amp;gt;    i use attr for "enabled" and class for classes. :o&lt;br /&gt;&amp;lt;thelaings&amp;gt;    i'm trying to get a better understanding of .data&lt;br /&gt;&amp;lt;timmywil&amp;gt;    sounds right&lt;br /&gt;&amp;lt;thelaings&amp;gt;    is it only used for ajax or for data already on the page?&lt;br /&gt;&amp;lt;ajpiano&amp;gt;    thelaings: .data() is just a accessing a gigantic cache&lt;br /&gt;&amp;lt;ajpiano&amp;gt;    $.cache&lt;br /&gt;&amp;lt;ajpiano&amp;gt;    everything is stored in that cache&lt;br /&gt;&amp;lt;BarelyFitz&amp;gt;    erichynds: custom attributes causing memory leaks? isn't that only if you attach a javascript object to it?&lt;br /&gt;&amp;lt;ajpiano&amp;gt;    event handlers, and any arbitrary .data() that is assigned by you, jquery, or any plugins&lt;br /&gt;&amp;lt;innociv&amp;gt;    .data() is sort of like having &amp;lt;element CustomDataCacheProperty=""&amp;gt;&lt;br /&gt;&amp;lt;innociv&amp;gt;    SORT OF.&lt;br /&gt;&amp;lt;erichynds&amp;gt;    BarelyFitz: I don't know the specifics - just what i've been told. that is entirely possible&lt;br /&gt;&amp;lt;paul_irish&amp;gt;    khase: classes are faster for traversing/selecting&lt;br /&gt;&amp;lt;khase&amp;gt;    h,&lt;br /&gt;&amp;lt;khase&amp;gt;    hm, gotta rethink my code then.&lt;br /&gt;&amp;lt;innociv&amp;gt;    faster than attr? Yeah.&lt;thelaings&gt;&lt;timmywil&gt;&lt;erichynds&gt;&lt;khase&gt;&lt;thelaings&gt;&lt;timmywil&gt;&lt;thelaings&gt;&lt;ajpiano&gt;&lt;ajpiano&gt;&lt;ajpiano&gt;&lt;barelyfitz&gt;&lt;ajpiano&gt;&lt;innociv&gt;&lt;element customdatacacheproperty=""&gt;&lt;innociv&gt;&lt;erichynds&gt;&lt;paul_irish&gt;&lt;khase&gt;&lt;khase&gt;&lt;innociv&gt;&lt;br /&gt;&lt;br /&gt;&lt;/innociv&gt;&lt;/khase&gt;&lt;/khase&gt;&lt;/paul_irish&gt;&lt;/erichynds&gt;&lt;/innociv&gt;&lt;/element&gt;&lt;/innociv&gt;&lt;/ajpiano&gt;&lt;/barelyfitz&gt;&lt;/ajpiano&gt;&lt;/ajpiano&gt;&lt;/ajpiano&gt;&lt;/thelaings&gt;&lt;/timmywil&gt;&lt;/thelaings&gt;&lt;/khase&gt;&lt;/erichynds&gt;&lt;/timmywil&gt;&lt;/thelaings&gt;&lt;/khase&gt;&lt;/blockquote&gt;It sounds likely that .class is faster that [attr]. I was curious and wrote a small &lt;a href="http://notsosimplesudoku.googlecode.com/svn/tests/017.htm"&gt;test case&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Firefox 3.6, JIT enabled, more runs/s is better:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.abload.de/img/jqueryselector63zz.png" /&gt;&lt;br /&gt;&lt;br /&gt;Create() addes 100 span childs to the body. Every second of these has the customattr-attribute set to "value". The rest has the class customclass. Using create(200,5) would create 200 spans of which each 5th has the custom attr instead of a class.&lt;br /&gt;&lt;br /&gt;testClass tries to call $(".customclass") as often as possible within a second; obviously testAttr calls $("[customAttr]").&lt;br /&gt;&lt;br /&gt;For some weird Firefox internal reason [attr] is slightly faster than .class. Using SRWareIron though, with the same settings, .class is faster:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:'Times New Roman';font-size:medium;"  &gt;&lt;span class="Apple-style-span"  style="font-family:monospace,sans-serif;"&gt;&lt;div class="console-message console-js-source console-log-level" style="position: relative; border-bottom: 1px solid rgb(240, 240, 240); padding: 1px 22px 1px 24px; min-height: 16px;"&gt;&lt;span class="console-message-text" style="white-space: pre-wrap;"&gt;&lt;span style=""&gt;testClass avg runs/sec: &lt;span class="console-formatted-number" style=""&gt;31579&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="console-message console-js-source console-log-level" style="position: relative; border-bottom: 1px solid rgb(240, 240, 240); padding: 1px 22px 1px 24px; min-height: 16px;"&gt;&lt;span class="console-message-text" style="white-space: pre-wrap;"&gt;&lt;span style=""&gt;testAttr avg runs/sec: &lt;span class="console-formatted-number" style=""&gt;29970&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;So what do we learn from this? Even though [attr] might be faster in some cases, do not ninja-optimize your classes to custom attributes! Classes should be the way to go for css and boolean data.&lt;br /&gt;&lt;br /&gt;Last but not least: Paul Irish, you are wrong! :P But hat is what makes us human, so dont worry.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mfG Kambfhase&lt;br /&gt;&lt;br /&gt;ps. Paul, you are awesome. What you do is awesome and yayQuery is So Just Cloud!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6227614017686439825-8769604745655608343?l=kambfhase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kambfhase.blogspot.com/feeds/8769604745655608343/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://kambfhase.blogspot.com/2010/02/scientific-research-proves-paul-irish.html#comment-form' title='1 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/8769604745655608343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/8769604745655608343'/><link rel='alternate' type='text/html' href='http://kambfhase.blogspot.com/2010/02/scientific-research-proves-paul-irish.html' title='Scientific Research proves: Paul Irish is human!'/><author><name>Kambfhase</name><uri>http://www.blogger.com/profile/05582566388912356628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_5rEdSMoHw-o/S3HBXUCMz5I/AAAAAAAAAAM/DC5Na_KbgM8/s1600-R/3394a3d688d637202e69f7676295dd0f.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6227614017686439825.post-2188045538161454611</id><published>2010-02-09T09:43:00.000-08:00</published><updated>2010-02-09T09:55:21.891-08:00</updated><title type='text'>Hello world!</title><content type='html'>Welcome, stranger!&lt;br /&gt;&lt;br /&gt;I'll start this new blog with a project of mine I have been working on for quite a long time: &lt;a href="http://code.google.com/p/notsosimplesudoku/"&gt;NotSoSimpleSudoku&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It basically is a Sudoku-engine written in web-based languages as HTML, CSS ans JavaScript. The little tricky part about this engine compared to other is, that it supports different sudoku variations. An  8x8 grid sudoku and 9x9 X-sudokus are already implemented.&lt;br /&gt;&lt;br /&gt;To try it out simply load this &lt;a href="http://notsosimplesudoku.googlecode.com/files/0.1alpha3r33.zip"&gt;archive&lt;/a&gt; or head over to googlecode and have a look in the trunk.&lt;br /&gt;&lt;br /&gt;I hope you enjoy my blog.&lt;br /&gt;&lt;br /&gt;mfG Kambfhase&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6227614017686439825-2188045538161454611?l=kambfhase.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kambfhase.blogspot.com/feeds/2188045538161454611/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://kambfhase.blogspot.com/2010/02/hello-world.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/2188045538161454611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6227614017686439825/posts/default/2188045538161454611'/><link rel='alternate' type='text/html' href='http://kambfhase.blogspot.com/2010/02/hello-world.html' title='Hello world!'/><author><name>Kambfhase</name><uri>http://www.blogger.com/profile/05582566388912356628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_5rEdSMoHw-o/S3HBXUCMz5I/AAAAAAAAAAM/DC5Na_KbgM8/s1600-R/3394a3d688d637202e69f7676295dd0f.png'/></author><thr:total>0</thr:total></entry></feed>
