<?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; debug</title> <atom:link href="http://www.mysrc.de/tag/debug/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>jQuery Debugger</title><link>http://www.mysrc.de/jquery/jquery-debugger/</link> <comments>http://www.mysrc.de/jquery/jquery-debugger/#comments</comments> <pubDate>Wed, 18 Mar 2009 21:29:45 +0000</pubDate> <dc:creator>Stefan Huissel</dc:creator> <category><![CDATA[jQuery]]></category> <category><![CDATA[debug]]></category> <category><![CDATA[fehlersuche]]></category> <category><![CDATA[noConflict]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=262</guid> <description><![CDATA[Beim Entwickeln von Prgrammcode ist ein tieferer Blick in die Objektstruktur oft unabdingbar. Ein guter Debugger kann einem stundenlanges suchen nach Fehlern ersparen. Deshalb will ich kurz einen jQuery Debugger vorstellen. Downloaden könnt ihr ihn euch als jQuery Plugin auf: jQuery Debugger Nachdem das Plugin eingebunden ist (ganz normal mit script-Tag und src-Attribut), könnt ihr [...]]]></description> <content:encoded><![CDATA[<p>Beim Entwickeln von Prgrammcode ist ein tieferer Blick in die Objektstruktur oft unabdingbar. Ein guter Debugger kann einem stundenlanges suchen nach Fehlern ersparen. Deshalb will ich kurz einen jQuery Debugger vorstellen. Downloaden könnt ihr ihn euch als jQuery Plugin auf: <a
href="http://wellstyled.com/en/javascript-debug-jquery-plugin/">jQuery Debugger</a><br
/> Nachdem das Plugin eingebunden ist (ganz normal mit script-Tag und src-Attribut), könnt ihr es mit folgendem Code aufrufen:</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('p262code4'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p2624"><td
class="line_numbers"><pre>1
2
3
</pre></td><td
class="code" id="p262code4"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> debuggen <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> jQuery.<span style="color: #660066;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// ...</span>
debuggen.<span style="color: #660066;">dump</span><span style="color: #009900;">&#40;</span>Object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>Nun noch ein kleines Beispiel dazu:</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('p262code5'); return false;">View Code</a> HTML</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p2625"><td
class="line_numbers"><pre>1
</pre></td><td
class="code" id="p262code5"><pre class="html" style="font-family:monospace;">&lt;input name=&quot;LieferName&quot;  value=&quot;&quot; class=&quot;validate['required','length[6,-1]']&quot; type=&quot;text&quot; id=&quot;LieferName&quot; /&gt;</pre></td></tr></table></div><p>Der Code um sich das Objekt näher anzuschauen kann 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('p262code6'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p2626"><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td
class="code" id="p262code6"><pre class="javascript" style="font-family:monospace;">debug <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> jQuery.<span style="color: #660066;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	posTo <span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span> x<span style="color: #339933;">:</span><span style="color: #3366CC;">'right'</span><span style="color: #339933;">,</span> y<span style="color: #339933;">:</span><span style="color: #3366CC;">'bottom'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	width<span style="color: #339933;">:</span> <span style="color: #3366CC;">'480px'</span><span style="color: #339933;">,</span>
	height<span style="color: #339933;">:</span> <span style="color: #3366CC;">'50%'</span><span style="color: #339933;">,</span>
	itemDivider <span style="color: #339933;">:</span> <span style="color: #3366CC;">'&lt;hr&gt;'</span><span style="color: #339933;">,</span>
	listDOM <span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span> <span style="color: #3366CC;">'tagName'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'innerText'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'href'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'value'</span> <span style="color: #009900;">&#93;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> showMeDebug<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> input <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'LieferName'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  debug.<span style="color: #660066;">dump</span><span style="color: #009900;">&#40;</span>input<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>Hier würde jetzt nach Aufruf der Funktion showMeDebug auf der unteren rechten Seite des Bildschirms eine Box, in der alle alle Attribute des &#8220;listDOM&#8221; für das Objekt &#8220;input&#8221; stehen, angezeigt.<br
/> Für ein Formularfeld ist diese Funktion nur teilweise interessant. Sinnvoller ist der Einsatz des Debuggers für komplexe Objekte vor allem natürlich Klasseninstanzen.</p><p>Zu beachten ist, dass vor &#8220;debug = new jQuery.debug&#8221; u. U. die &#8220;var&#8221; Deklaration von JavaScript stehen und &#8220;jQuery&#8221; durch $ ersetzt werden muss. Obiges Skript wurde im noConflict Mode von jQuery ausgeführt.</p><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>4. September 2009 -- <a
href="http://www.mysrc.de/jquery/praxistip-output-element-des-jquery-validate-plugin-andern/" title="Praxistip: Output Element des jQuery Validate Plugin ändern">Praxistip: Output Element des jQuery Validate Plugin ändern</a></li><li>18. Mai 2009 -- <a
href="http://www.mysrc.de/mootools/jquery-noconflict-mode/" title="jQuery noConflict Mode">jQuery noConflict Mode</a></li><li>1. Dezember 2010 -- <a
href="http://www.mysrc.de/html5/jquery-mobile-der-eitenaufbau/" title="jQuery Mobile &#8211; Der Seitenaufbau">jQuery Mobile &#8211; Der Seitenaufbau</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/jquery/jquery-debugger/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
