<?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>mysrc.de &#187; Coding</title> <atom:link href="http://www.mysrc.de/tag/coding/feed/" rel="self" type="application/rss+xml" /><link>http://www.mysrc.de</link> <description>- jQuery, MooTools, HTML5, AJAX</description> <lastBuildDate>Tue, 14 Jun 2011 08:24:25 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>IxEdit &#8211; jQuery the easy way</title><link>http://www.mysrc.de/jquery/ixedit-jquery-the-easy-way/</link> <comments>http://www.mysrc.de/jquery/ixedit-jquery-the-easy-way/#comments</comments> <pubDate>Sun, 06 Sep 2009 13:43:37 +0000</pubDate> <dc:creator>Stefan Huissel</dc:creator> <category><![CDATA[JS-Framework Tutorials]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[Coding]]></category> <category><![CDATA[jQuery UI]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=860</guid> <description><![CDATA[Mit IxEdit ist es möglich JQuery Funktionen ohne JS-Programmierung direkt on-the-Fly im Browser den gewünschten HTML Elementen zuzuweißen. Statt vieler weiterer Worte das Demo Video: Wenn ihr es ausprobieren wollt, so gehts: 1. Als erstes die notwendigen IxEdit Dateien von IxEdit herunterladen 2. Das das Google Gears Firefox Addon Google Gears Portable installieren und Browser [...]]]></description> <content:encoded><![CDATA[<p>Mit <a
href="http://www.ixedit.com/" target="blank">IxEdit</a> ist es möglich JQuery Funktionen <strong>ohne JS-Programmierung</strong> direkt <strong>on-the-Fly</strong> im Browser den gewünschten HTML Elementen zuzuweißen. Statt vieler weiterer Worte das Demo Video:</p><p><object
width="425" height="344"><param
name="movie" value="http://www.youtube.com/v/OblVz5-D8EI&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=ja&#038;feature=player_embedded&#038;fs=1"></param><param
name="allowFullScreen" value="true"></param><param
name="allowScriptAccess" value="always"></param><embed
src="http://www.youtube.com/v/OblVz5-D8EI&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=ja&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object></p><p>Wenn ihr es ausprobieren wollt, so gehts:</p><p>1. Als erstes die notwendigen IxEdit Dateien von <a
href="http://www.ixedit.com/download/" target="blank">IxEdit</a> herunterladen</p><p>2. Das das Google Gears Firefox Addon <a
href="https://addons.mozilla.org/de/firefox/addon/13492" target="blank">Google Gears Portable</a> installieren und Browser neu starten</p><p>3. Im entpackten IxEdit Ordner die index.html aufrufen</p><p>Nun könnt ihr den bestehenden HTML Elementen nach belieben jQuery Events zuweißen. Das Tool ist <strong>ideal zum Experimentieren</strong> mit verschiedenen Effekten und auch allgemein um sich einen besseren Überblick über die Möglichkeiten von JQuery zu verschaffen.</p><p>Nachdem alle gewünschten Effekte integriert sind, wird mit <strong>der Deploy-Funktion</strong> der entsprechende jQuery Code angezeigt, der dann in das Quelldokument kopiert werden kann.</p><p>Easy oder!?</p><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>16. Oktober 2009 -- <a
href="http://www.mysrc.de/jquery/jquery-accessible-ria-widgets-fur-jedermann/" title="jQuery &#8211; Accessible-RIA &#8211; Widgets für jedermann">jQuery &#8211; Accessible-RIA &#8211; Widgets für jedermann</a></li><li>27. Juli 2009 -- <a
href="http://www.mysrc.de/jquery/jquery-tutorial-closing-an-accordion-automatically/" title="jQuery Tutorial &#8211; Closing an Accordion automatically">jQuery Tutorial &#8211; Closing an Accordion automatically</a></li><li>6. Juni 2009 -- <a
href="http://www.mysrc.de/jquery/tools-fur-jquery-ein-plugin-ui-elemente/" title="Tools für jQuery &#8211; Ein Plugin UI Elemente">Tools für jQuery &#8211; Ein Plugin UI Elemente</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/jquery/ixedit-jquery-the-easy-way/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Lazy &#8211; jQuery Plugins on-demand laden</title><link>http://www.mysrc.de/jquery/lazy-jquery-plugins-on-demand-laden/</link> <comments>http://www.mysrc.de/jquery/lazy-jquery-plugins-on-demand-laden/#comments</comments> <pubDate>Tue, 12 May 2009 11:06:13 +0000</pubDate> <dc:creator>Oliver Storm</dc:creator> <category><![CDATA[Web-Development]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[Best Practice]]></category> <category><![CDATA[Coding]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=474</guid> <description><![CDATA[Die Tage schon bin ich über ein schönes kleines jQuery-Plugin names Lazy gestolpert. Bei lazy handelt es sich um ein nur 530Byte großes Plugin das gerade bei großen Projekten einen gehörigen Vorteil, was das Laden von anderen jQuery-Plugins angeht, bringen kann. Lazy tut nämlich nichts anderes, als Plugins nur dann zu initialisieren wenn auch irgendwo [...]]]></description> <content:encoded><![CDATA[<p><img
class="alignnone size-full wp-image-477" title="lazy - jQuery Plugins on demand laden" src="http://www.mysrc.de/wp-content/uploads/2009/05/lazy.jpg" alt="lazy - jQuery Plugins on demand laden" width="460" height="120" /></p><p>Die Tage schon bin ich über ein schönes kleines<strong> jQuery-Plugin</strong> names <a
title="jQuery Plugin Lazy" href="http://www.unwrongest.com/projects/lazy/" target="_self">Lazy</a> gestolpert.<br
/> Bei lazy handelt es sich um ein nur 530Byte großes Plugin das gerade bei großen Projekten einen gehörigen Vorteil, was das Laden von anderen <strong>jQuery-Plugins</strong> angeht, bringen kann.</p><p><strong>Lazy</strong> tut nämlich nichts anderes, als Plugins nur dann zu initialisieren wenn auch irgendwo wirklich ein Aufruf für die Funktion erfolgt.<br
/> Sprich ihr könnt über lazy einbinden was ihr wollt, geladen wird es nur wenn es auch wirklich gebraucht wird.</p><p>Hier noch ein kleines <strong>Code-Beispiel</strong>:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p474code2'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p4742"><td
class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td
class="code" id="p474code2"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">lazy</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'jquery.elastic.js'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'elastic'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$.<span style="color: #660066;">lazy</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'jquery.validation.js'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'validate'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$.<span style="color: #660066;">lazy</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'jquery.ajaxdotnet.js'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'ajaxDotNet'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// And then you use you plugins as you always do</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'textarea'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">elastic</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>Weiter Infos sowie eine Demo und die Files zum Download findet Ihr auf der offiziellen Seite:<br
/> <a
title="jQuery Plugin Lazy" href="http://www.unwrongest.com/projects/lazy/" target="_self">http://www.unwrongest.com/projects/lazy/</a></p><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>26. Februar 2009 -- <a
href="http://www.mysrc.de/jquery/tips-zum-umgang-mit-jquery/" title="Tips zum Umgang mit jQuery">Tips zum Umgang mit jQuery</a></li><li>19. November 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-suchfeld-leeren-on-focus-jquery/" title="Praxistipp: Suchfeld leeren on focus (jQuery)">Praxistipp: Suchfeld leeren on focus (jQuery)</a></li><li>23. März 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-%e2%80%93-jqtransform-bug-bei-input-in-firefox-3-5-2/" title="Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2">Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/jquery/lazy-jquery-plugins-on-demand-laden/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Selektoren in jQuery</title><link>http://www.mysrc.de/jquery/selektoren-in-jquery/</link> <comments>http://www.mysrc.de/jquery/selektoren-in-jquery/#comments</comments> <pubDate>Fri, 13 Mar 2009 18:25:49 +0000</pubDate> <dc:creator>Stefan Huissel</dc:creator> <category><![CDATA[jQuery]]></category> <category><![CDATA[Coding]]></category> <category><![CDATA[Selektoren]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=219</guid> <description><![CDATA[Ich möchte eine Serie starten in der Stück für Stück der Umgang mit jQuery seinen Elementen, Selektoren, Plugins, etc. beschrieben wird. Beginnen werde ich mit einer Beschreibung der verschiedenen Selektoren.. Grundlegende Selektoren $(&#8216;code&#8217;) $(&#8216;#someID&#8217;) $(&#8216;.someClass&#8217;) $(&#8216;*&#8217;) ?View Code JAVASCRIPT1 XXX.css&#40;&#34;border&#34;,&#34;3px solid red&#34;&#41;; Für XXX wird einfach einer der obigen Selektoren eingesetzt. Besonders ist die Form [...]]]></description> <content:encoded><![CDATA[<p>Ich möchte eine Serie starten in der Stück für Stück der Umgang mit jQuery seinen Elementen, Selektoren, Plugins, etc. beschrieben wird. Beginnen werde ich mit einer Beschreibung der verschiedenen Selektoren..</p><h3>Grundlegende Selektoren</h3><ul><li>$(&#8216;code&#8217;)</li><li>$(&#8216;#someID&#8217;)</li><li>$(&#8216;.someClass&#8217;)</li><li>$(&#8216;*&#8217;)</li></ul><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p219code8'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p2198"><td
class="line_numbers"><pre>1
</pre></td><td
class="code" id="p219code8"><pre class="javascript" style="font-family:monospace;">XXX.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;border&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;3px solid red&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>Für XXX wird einfach einer der obigen Selektoren eingesetzt. Besonders ist die Form mit *, die auf alle Elemente in dem Dokument angewendet wird.</p><hr
style="color: #cccccc; height: 1px;" /><h3>Einfache Filter Funktionen</h3><ul><li>$(&#8216;li:first&#8217;)</li><li>$(&#8216;li:last&#8217;)</li><li>$(&#8216;li:not(li:first)&#8217;)</li><li>$(&#8216;li:even&#8217;)</li><li>$(&#8216;li:odd&#8217;)</li></ul><p>Diese Selektoren wählen Elemente unter einer bestimmten Bedinung aus. &#8220;li-first&#8221; z.B. ist eine Referenz auf das erste Objekt einer ungeordneten Liste. &#8220;li:not(li:first)&#8221; gibt Referenzen auf alle Listenpunkte ausser dem ersten aus und erlaubt eine gewünschte Manipulation dieser Objekte.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p219code9'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p2199"><td
class="line_numbers"><pre>1
</pre></td><td
class="code" id="p219code9"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;tr:even&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;background-color&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;#bbbbff&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>Dieser Code würde in einer Tabelle für jeden geradzahligen Index die Hintergrundfarbe mittels der CSS Eigenschaft auf einen neuen Farbton ändern.</p><hr
style="color: #cccccc; height: 1px;" /><h3>Content Filter</h3><ul><li>$(&#8216;li:contains(&#8216;stringXXX&#8217;)')</li><li>$(&#8216;:empty&#8217;)</li><li>$(&#8216;li:has(a)&#8217;)</li><li>$(&#8216;p:parent&#8217;)</li></ul><p>&#8220;contains&#8221; würde hier alle ListenElemente verändern in denen die Stringphrase &#8220;stringXXX&#8221; vorkommt.<br
/> &#8220;empty&#8221; prüft alle Elemente darauf ob ein Kindknoten im DOM-Baum vorhanden ist. Auch ein einfacher Text in ein p-Tag würde nicht zurückgegeben werden.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p219code10'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p21910"><td
class="line_numbers"><pre>1
</pre></td><td
class="code" id="p219code10"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;td:empty&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Was empty!&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'background'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'rgb(255,220,200)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><hr
style="color: #cccccc; height: 1px;" /><h3>Visibility Filter</h3><ul><li>$(&#8216;:hidden&#8217;)</li><li>$(&#8216;:visible&#8217;)</li></ul><p>Siehe dazu: <a
href="http://www.mysrc.de/jquery/3-einfache-tips-fur-die-anpassung-auf-jquery-13/">3-einfache-tips-fur-die-anpassung-auf-jquery-1.3</a></p><hr
style="color: #cccccc; height: 1px;" /><h3>Attribut Filter</h3><ul><li>$(&#8216;li[class]&#8216;)</li><li>$(&#8216;a[rel="self"]&#8216;)</li><li>$(&#8216;[class^="my"]&#8216;)</li><li>$(&#8216;a[title$="blog"]&#8216;)</li></ul><p>Eine interessante Möglichkeit ist das Filtern von Elementen anhand eines Attributes. &#8220;li[class]&#8221; spricht das oder die Element(e) an, die eine Attribut class besitzen.<br
/> &#8220;a[rel="self"]&#8221; zeigt auf Elemente von link Tags, welche im Attribut &#8220;rel&#8221; den Wert &#8220;self&#8221; besitzen.<br
/> Der dritte Listepunkt zeigt auf alle Knotenelemente die bei ihrem class Attribut mit &#8220;my&#8221; beginnen.<br
/> Der letzte Punkt stellt eine Möglichkeit dar, nach Elementen zu suchen, die am ende eines Attributes ein bestimmten String als Wert besitzen.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p219code11'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p21911"><td
class="line_numbers"><pre>1
</pre></td><td
class="code" id="p219code11"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[class^='my']&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;news here!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><hr
style="color: #cccccc; height: 1px;" /><h3>Formulare</h3><ul><li>$(&#8216;:input&#8217;)</li><li>$(&#8216;:text&#8217;)</li><li>$(&#8216;:radio&#8217;)</li><li>$(&#8216;:checkbox&#8217;)</li><li>$(&#8216;:submit&#8217;)</li><li>$(&#8216;:image&#8217;)</li><li>&#8230;</li></ul><p>Hiermit lassen sich in HTML spezifizierten Formen von Formularfeldern ansprechen.</p><hr
style="color: #cccccc; height: 1px;" /><h3>Formular Filter</h3><ul><li>$(&#8216;input:enabled&#8217;)</li><li>$(&#8216;:disabled&#8217;)</li><li>$(&#8216;:checked&#8217;)</li><li>$(&#8216;:selected&#8217;)</li></ul><p>Mit diesen Filtern lassen sich abgeleitet von verschiedenen Eigenschaften der Formularfelder Elemente referenzieren. Also kann mit können mithilfe obiger Selektoren beispielsweise alle Felder die derzeit die Eigenschaft disabled besitzen ansprechen und manipulieren.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p219code12'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p21912"><td
class="line_numbers"><pre>1
</pre></td><td
class="code" id="p219code12"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input:disabled&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;this is it&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>14. November 2010 -- <a
href="http://www.mysrc.de/jquery/fadetoggle-die-neue-in-jquery-1-4-4/" title="fadeToggle &#8211; die Neue in jQuery 1.4.4">fadeToggle &#8211; die Neue in jQuery 1.4.4</a></li><li>26. November 2009 -- <a
href="http://www.mysrc.de/allgemein/jquery-howto-traversing/" title="jQuery HowTo: Traversing">jQuery HowTo: Traversing</a></li><li>12. Mai 2009 -- <a
href="http://www.mysrc.de/jquery/lazy-jquery-plugins-on-demand-laden/" title="Lazy &#8211; jQuery Plugins on-demand laden">Lazy &#8211; jQuery Plugins on-demand laden</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/jquery/selektoren-in-jquery/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Tips zum Umgang mit jQuery</title><link>http://www.mysrc.de/jquery/tips-zum-umgang-mit-jquery/</link> <comments>http://www.mysrc.de/jquery/tips-zum-umgang-mit-jquery/#comments</comments> <pubDate>Thu, 26 Feb 2009 10:24:25 +0000</pubDate> <dc:creator>Stefan Huissel</dc:creator> <category><![CDATA[jQuery]]></category> <category><![CDATA[Best Practice]]></category> <category><![CDATA[Coding]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=121</guid> <description><![CDATA[Fertige Komponenten in die eigenen Sites bauen ist das eine. Das andere ist natürlich die Funktionailität selbst zu bauen. Dafür sind detailierte Kenntnisse über das Coding mittels jQuery notwendig. Hier mal ein paar Beispiele zum warm werden.. each statt for oder while For-Schleifen mit Inkrementor, While-Schleifen mit Abbruch Bediengung. Kein großes Problem, aber oft umständlich. [...]]]></description> <content:encoded><![CDATA[<p>Fertige Komponenten in die eigenen Sites bauen ist das eine. Das andere ist natürlich die Funktionailität selbst zu bauen. Dafür sind detailierte Kenntnisse über das Coding mittels jQuery notwendig. Hier mal ein paar Beispiele zum warm werden..<br
/> each statt for oder while</p><p>For-Schleifen mit Inkrementor, While-Schleifen mit Abbruch Bediengung. Kein großes Problem, aber oft umständlich. Viel einfacher geht es mit der each oder for-each Schleife. Vor allem in Verbindung mit Arrays. Auch in Java 5 steht das each wieder zur Verfügung. Hier mal ein kleines Beispiel:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p121code17'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p12117"><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td
class="code" id="p121code17"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> myArray <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'MooTools'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'Prototype'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'jQuery'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
$.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>myArray<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>index<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Mache etwas mit dem Arrayelement</span>
<span style="color: #006600; font-style: italic;">// return false für Abbruch, true für weitermachen</span>
<span style="color: #006600; font-style: italic;">// each wird automatisch verlassen wenn jedes Element</span>
<span style="color: #006600; font-style: italic;">// durchlaufen ist</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><h3>Filter Funktion</h3><p>Damit lassen sich Elemente aus dem DOM-Baum einfach entfernen. Im Code kann das wie folgt aussehen:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p121code18'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p12118"><td
class="line_numbers"><pre>1
2
3
4
</pre></td><td
class="code" id="p121code18"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">filter</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">childNodes</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">// Gibt einen Boolschen Wert zurück</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><h3>Eventhandling mal anders</h3><p>Um ein Event an ein Element zu binden ist nicht zwingend die ID des Elements notwendig. Dieser Vorgang lässt sich auch einfach mittels Variable umsetzen.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p121code19'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p12119"><td
class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td
class="code" id="p121code19"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> myDiv <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div&gt;'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Verwende myDiv um Click Funktion herzustellen</span>
myDiv.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// do something......</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div><h3>Logger für Performance Messung</h3><p>Es gibt für ein Problem immer viele Lösungen. Um rauszufinden welche sich besser eignet stehen mit jQuery Konsolen Befehle zur Verfügung.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p121code20'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p12120"><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td
class="code" id="p121code20"><pre class="javascript" style="font-family:monospace;">console.<span style="color: #660066;">time</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Test1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #006600; font-style: italic;">// Programmlogik der ersten Variante..</span>
console.<span style="color: #660066;">timeEnd</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Test1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
console.<span style="color: #660066;">time</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Test2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #006600; font-style: italic;">// Logik der Zweiten...</span>
console.<span style="color: #660066;">timeEnd</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Test2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Das Firefox Plugin &quot;Firebug&quot; wird das Ergebnis mitloggen</span></pre></td></tr></table></div><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>12. Mai 2009 -- <a
href="http://www.mysrc.de/jquery/lazy-jquery-plugins-on-demand-laden/" title="Lazy &#8211; jQuery Plugins on-demand laden">Lazy &#8211; jQuery Plugins on-demand laden</a></li><li>19. November 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-suchfeld-leeren-on-focus-jquery/" title="Praxistipp: Suchfeld leeren on focus (jQuery)">Praxistipp: Suchfeld leeren on focus (jQuery)</a></li><li>23. März 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-%e2%80%93-jqtransform-bug-bei-input-in-firefox-3-5-2/" title="Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2">Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/jquery/tips-zum-umgang-mit-jquery/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
