<?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>elektro:elch &#187; Programmierung</title>
	<atom:link href="http://elektroelch.de/blog/category/programmierung/feed/" rel="self" type="application/rss+xml" />
	<link>http://elektroelch.de</link>
	<description>Es ist nicht ungefährlich, wenn ein Volk lesen und schreiben kann.</description>
	<lastBuildDate>Fri, 11 May 2012 10:20:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<atom:link rel='hub' href='http://elektroelch.de/?pushpress=hub'/>
		<item>
		<title>PHP/HTML: einfache und doppelte Anführungszeichen - Code kann wesentlich klarer sein, wenn man die Spezifikationen kennt</title>
		<link>http://elektroelch.de/blog/2011/05/30/phphtml-einfache-und-doppelte-anfuehrungszeichen/</link>
		<comments>http://elektroelch.de/blog/2011/05/30/phphtml-einfache-und-doppelte-anfuehrungszeichen/#comments</comments>
		<pubDate>Mon, 30 May 2011 09:04:19 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[Programmierung]]></category>

		<guid isPermaLink="false">http://elektroelch.de/?p=2282</guid>
		<description><![CDATA[Wenn ein PHP-Programmierer einen Link aus Variablen erstellt, kann man häufig folgenden Code sehen: echo '&#60;a href=&#34;' . $link . '&#34; id=&#34;' . $id .'&#34; class=&#34;' . $class . '&#34;&#62;' . $linktext . '&#60;/a&#62;'; oder ?&#62; &#60;a href=&#34;&#60;?php echo $link; ?&#62;&#34; id=&#34;&#60;?php echo $id; ?&#62;&#34; class=&#34;&#60;?php echo $class; ?&#62;&#34;&#60;?php echo $linktext; ?&#62;&#34;&#60;/a&#62; &#60;?php oder echo [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn ein PHP-Programmierer einen Link aus Variablen erstellt, kann man häufig folgenden Code sehen:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$link</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; id=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; class=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> 
       <span style="color: #000088;">$linktext</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span></pre></div></div>

<p>oder</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">?&gt;
&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$link</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$id</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; 
   class=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$class</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$linktext</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&lt;/a&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span></pre></div></div>

<p>oder</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$link</span><span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$id</span><span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$class</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #006699; font-weight: bold;">$linktext</span>&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Abgesehen vom persönlichen Stil des Programmierers haben die Code-Beispiele eines gemeinsam: sie sind schlecht zu lesen.<br />
&#8222;Klar!&#8220;, werden jetzt die Programmierer sagen, &#8222;In HTML müssen die Attribute in doppelten Anführungszeichen stehen und in PHP muss man eine der oben gezeigten Methoden verwenden&#8220;. Sicher? Müssen Attribute <em>wirklich</em> in doppelten Anführungszeichen stehen? Die einfache Antwort ist: Nein!<br />
Ein Blick in die <a href="http://www.edition-w3c.de/TR/1999/REC-html401-19991224/intro/sgmltut.html#h-3.2.2">Spezifikation</a> bringt Folgendes an den Tag:</p>
<p>[&#8230;]Standardmäßig verlangt SGML, dass alle Attributwerte entweder von doppelten Anführungszeichen (ASCII dezimal 34) oder einfachen Anführungszeichen (ASCII dezimal 39) begrenzt werden. Einfache Anführungszeichen können im Attributwert enthalten sein, wenn der Wert durch doppelte Anführungszeichen begrenzt ist und umgekehrt.[&#8230;]</p>
<p>Doppelte <strong>oder</strong> einfache Anführungszeichen. Das macht die Sache doch viel übersichtlicher:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;a href='<span style="color: #006699; font-weight: bold;">$link</span>' id='<span style="color: #006699; font-weight: bold;">$id</span>' class='<span style="color: #006699; font-weight: bold;">$class</span>'&gt;<span style="color: #006699; font-weight: bold;">$linktext</span>&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Wie man sieht ist der Code viel leichter zu lesen und das, weil man einfach die Spezifikation gelesen hat.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2011/05/30/phphtml-einfache-und-doppelte-anfuehrungszeichen/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tabelle zeilenweise ausblenden mit jQuery</title>
		<link>http://elektroelch.de/blog/2009/03/11/tabelle-zeilenweise-ausblenden-mit-jquery/</link>
		<comments>http://elektroelch.de/blog/2009/03/11/tabelle-zeilenweise-ausblenden-mit-jquery/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 14:54:16 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[Programmierung]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://elektroelch.de/blog/?p=504</guid>
		<description><![CDATA[Möchte man mit jQuery einige Zeilen aus einer Tabelle ausblenden, so könnte man auf folgende einfache Lösung verfallen: Ursprüngliche Tabelle: &#60;table&#62; &#60;tr&#62;&#60;td&#62;Zeile 1&#60;/td&#62;&#60;/tr&#62; &#60;tr&#62;&#60;td&#62;Zeile 2&#60;/td&#62;&#60;/tr&#62; &#60;tr&#62;&#60;td&#62;Zeile 3&#60;/td&#62;&#60;/tr&#62; &#60;/table&#62; Tabelle mit &#60;div&#62; und checkbox: &#60;table&#62; &#60;tr&#62;&#60;td&#62;Zeile 1&#60;/td&#62;&#60;/tr&#62; &#60;div&#62; &#60;tr&#62;&#60;td&#62;Zeile 2&#60;/td&#62;&#60;/tr&#62; &#60;/div&#62; &#60;tr&#62;&#60;td&#62;Zeile 3&#60;/td&#62;&#60;/tr&#62; &#60;/table&#62; Zeile 2 verstecken jQuery-Code zum Ausblenden der Zeile 2: function hideshow&#40;&#41; &#123; [...]]]></description>
			<content:encoded><![CDATA[<p>Möchte man mit <a href="http://jquery.com/">jQuery</a> einige Zeilen aus einer Tabelle ausblenden, so könnte man auf folgende einfache Lösung verfallen:</p>
<p>Ursprüngliche Tabelle:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>table<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;</span>Zeile <span style="color: #cc66cc;">1</span><span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;&lt;/</span>tr<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;</span>Zeile <span style="color: #cc66cc;">2</span><span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;&lt;/</span>tr<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;</span>Zeile <span style="color: #cc66cc;">3</span><span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;&lt;/</span>tr<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>table<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Tabelle mit &lt;div&gt; und checkbox:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>table<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;</span>Zeile <span style="color: #cc66cc;">1</span><span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;&lt;/</span>tr<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;</span>Zeile <span style="color: #cc66cc;">2</span><span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;&lt;/</span>tr<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;</span>Zeile <span style="color: #cc66cc;">3</span><span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;&lt;/</span>tr<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>table<span style="color: #339933;">&gt;</span>
Zeile <span style="color: #cc66cc;">2</span> verstecken</pre></div></div>

<p>jQuery-Code zum Ausblenden der Zeile 2:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> hideshow<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;#cb_test&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>attr<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;checked&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;#test&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>hide<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">else</span> 
    $<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;#test&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>show<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Dieser Ansatz <strong>funktioniert leider nicht</strong>, da es nicht möglich ist, Tabellen- und Textstrukturierungelemente zu mischen. Seit HTML 4 gibt es allerdings das <em>&lt;tbody&gt;</em>-Element, das man für diesen Zweck verwenden kann:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>table<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;</span>Zeile <span style="color: #cc66cc;">1</span><span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;&lt;/</span>tr<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>tbody<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;</span>Zeile <span style="color: #cc66cc;">2</span><span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;&lt;/</span>tr<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;/</span>tbody<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;&lt;</span>td<span style="color: #339933;">&gt;</span>Zeile <span style="color: #cc66cc;">3</span><span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;&lt;/</span>tr<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>table<span style="color: #339933;">&gt;</span>
Zeile <span style="color: #cc66cc;">2</span> verstecken</pre></div></div>

<p>Laut <a href="http://validator.w3.org/">HTML-Validator</a> des <a href="http://w3.org/">W3C</a> ist diese Lösung &#8222;HTML 4.01 Transitional&#8220;-valide.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2009/03/11/tabelle-zeilenweise-ausblenden-mit-jquery/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Motorrad-Parkplatz Mashup</title>
		<link>http://elektroelch.de/blog/2007/08/30/motorrad-parkplatz-mashup/</link>
		<comments>http://elektroelch.de/blog/2007/08/30/motorrad-parkplatz-mashup/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 11:31:46 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[Programmierung]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[The Matrix]]></category>

		<guid isPermaLink="false">http://elektroelch.de/blog/2007/08/30/motorrad-parkplatz-mashup/</guid>
		<description><![CDATA[Als ich heute so durch die Stadt d&#252;ste, fielen mir der eine oder andere spezielle Parkplatz f&#252;r Motorr&#228;der auf, die ich bisher nicht kannte. Woher auch? Diese Parkpl&#228;tze findet man normalerweise auch erst nach Jahren in einer neuen Stadt. Eigentlich w&#228;re es doch eine gute Google-Maps Mashup-Idee: Man gibt eine Stadt ein und es werden [...]]]></description>
			<content:encoded><![CDATA[<p>Als ich heute so durch die Stadt d&uuml;ste, fielen mir der eine oder andere spezielle Parkplatz f&uuml;r Motorr&auml;der auf, die ich bisher nicht kannte. Woher auch? Diese Parkpl&auml;tze findet man normalerweise auch erst nach Jahren in einer neuen Stadt. </p>
<p>Eigentlich w&auml;re es doch eine gute Google-Maps Mashup-Idee: Man gibt eine Stadt ein und es werden die Park&uuml;l&auml;tze f&uuml;r Motorr&auml;der angezeigt, am besten mit Gr&ouml;&szlig;e und Beschaffenheit. Freiwillige? Ich habe zum Einen n&auml;mlich genug mit meinen WordPress-Plugins zu tun und zum anderen noch nie ein Google-Mashup geschrieben. Obwohl es nat&uuml;rlich eine interessante Herausforderung w&auml;re.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2007/08/30/motorrad-parkplatz-mashup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Update: streammp3 new</title>
		<link>http://elektroelch.de/blog/2006/09/06/update-streammp3-new/</link>
		<comments>http://elektroelch.de/blog/2006/09/06/update-streammp3-new/#comments</comments>
		<pubDate>Wed, 06 Sep 2006 11:04:39 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[Programmierung]]></category>
		<category><![CDATA[The Matrix]]></category>

		<guid isPermaLink="false">http://elektroelch.de/blog/2006/09/06/update-streammp3-new/</guid>
		<description><![CDATA[Ich habe nach einem Kommentar auf userscripts.org mein Greasemonkey-Skript streammp3 new ge&#228;ndert. Das Skript h&#228;ngt jetzt nichtm ehr vom Kontakt zu meinem Server ab, was insofern ganz praktisch ist, da nach einem Serverumzug das entscheidende PHP-Skript nicht mehr funktionierte. BTW: Das Skript durchsucht die aktuelle Webseite nach MP3-Links und f&#252;gt ein Icon ein, &#252;ber das [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe nach einem Kommentar auf <a href="userscripts.org">userscripts.org</a> mein <a href="http://greasemonkey.mozdev.org/">Greasemonkey</a>-Skript <a href="http://elektroelch.de/streammp3">streammp3 new</a> ge&auml;ndert.<br />
Das Skript h&auml;ngt jetzt nichtm ehr vom Kontakt zu meinem Server ab, was insofern ganz praktisch ist, da nach einem Serverumzug das entscheidende PHP-Skript nicht mehr funktionierte.<br />
BTW: Das Skript durchsucht die aktuelle Webseite nach MP3-Links und f&uuml;gt ein Icon ein, &uuml;ber das die MP3-Datei gestreamt werden kann und somit nicht erst nach einem vollst&auml;ndigen Download, sondern bereits nach dem ersten Kontakt abgespielt wird.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.de/blog/2006/09/06/update-streammp3-new/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

