<?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>crusy.net &#187; Javascript</title>
	<atom:link href="http://blog.crusy.net/category/computer/coding/javascript-coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.crusy.net</link>
	<description>- Established 1979 -</description>
	<lastBuildDate>Thu, 09 Feb 2012 20:46:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>EaselJS: Lift-off und OOP [UPDATE]</title>
		<link>http://blog.crusy.net/2012/01/07/easeljs-lift-off-und-oop/</link>
		<comments>http://blog.crusy.net/2012/01/07/easeljs-lift-off-und-oop/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 12:59:10 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Easel]]></category>
		<category><![CDATA[EaselJS]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1847</guid>
		<description><![CDATA[Also zuerst mal sollte diese EaselJS-Geschichte nun nicht mehr nur auf der Startseite funktionieren – mea culpa! Was EaselJS für mich so richtig interessant macht, ist die Tatsache, dass jedes Objekt auf dem Canvas eigenständig bleibt – so wie ich das Canvas-Element verstehe (als eine Art Bitmap/BitmapData), ist das nicht immer so? Dadurch kann man [...]]]></description>
			<content:encoded><![CDATA[<p>Also zuerst mal sollte <a title="EaselJS auf crusy.net" href="http://blog.crusy.net/2012/01/06/easeljs-kickoff/">diese EaselJS-Geschichte</a> nun nicht mehr nur auf der Startseite funktionieren – mea culpa!</p>
<p>Was EaselJS für mich so richtig interessant macht, ist die Tatsache, dass jedes Objekt auf dem Canvas eigenständig bleibt – so wie ich das Canvas-Element verstehe (als eine Art Bitmap/BitmapData), ist das nicht immer so? Dadurch kann man diesem kleinen Ball aus meiner Demo zum Beispiel einen Click-Handler geben, wie soeben geschehen.</p>
<p>Dabei ist mir Folgendes aufgefallen: Wenn ich tatsächlich nach und nach mehrere (ausgefeiltere) Demos bauen will, dann würde es der Übersichtlichkeit dienen, wenn ich diese voneinander separieren könnte. Am Liebsten in ihrem jeweils eigenen Objekt, von denen ich dann jeweils eines instanziiere. Nur: Wie funktioniert objektorientiertes Programmieren in JS? Meine JS-Kenntnisse sind etwas eingerostet, aber <a title="OOP in Javascript – Teil 1" href="http://javascript.jstruebig.de/javascript/792" target="_blank">hier</a> gibt es eine nette Basic- (!) Einführung.</p>
<p>Das Ergebnis kann man sich im <a title="crusy.js" href="http://blog.crusy.net/crusy/script/crusy.js" target="_blank">Quellcode</a> ansehen: Alle Variablen, die nur zur (bisher einzigen) Demo gehören, sind in &#8220;Klasse&#8221; &#8220;A&#8221; ausgelagert&#8230; I like! Nun könnte es eigentlich/vielleicht losgehen.</p>
<p>UPDATE:</p>
<p>Hm, andererseits wäre es auch interessant, &#8220;richtiges&#8221; OOP zu sehen, z.B. das Beerben von EaselJS&#8217; Klassen. Angenommen, ich möchte ein <a title="Wikipedia" href="http://de.wikipedia.org/wiki/Tic_Tac_Toe" target="_blank">TicTacToe</a>-Spiel bauen, dann hätte ich Kreuze und Kreise, die beide (mir fällt grad kein besserer Begriff ein) Spielsteine (<a title="leo" href="http://dict.leo.org/?search=spielstein" target="_blank">engl. &#8220;Tile&#8221;</a>)sind, der wieder meinetwegen ein Shape ist. Wenn ich <a title="OOP in JS, Part 2 : Inheritance" href="http://phrogz.net/js/classes/OOPinJS2.html" target="_blank">diese etwas ausgefeiltere Einführung</a> als Ausgangspunkt nehme, sieht das so aus:</p>
<pre>Tile.prototype = new Shape();
Tile.prototype.constructor = Tile;
Tile.prototype.g;
function Tile()
{
	this.g = new Graphics();
	Shape.prototype.initialize.call( this, this.g );
}

Circle.prototype = new Tile();
Circle.prototype.constructor = Circle;
function Circle()
{
	this.g.setStrokeStyle( 1 );
	this.g.beginStroke( Graphics.getRGB( 0, 0, 0 ) );
	this.g.drawCircle( 0, 0, 10 );
}

Cross.prototype = new Tile();
Cross.prototype.constructor = Cross;
function Cross()
{
	this.g.setStrokeStyle( 1 );
	this.g.beginStroke( Graphics.getRGB( 0, 0, 0 ) );
	this.g.moveTo( 0, 0 );
	this.g.lineTo( 18, 18 );
	this.g.moveTo( 0, 18 );
	this.g.lineTo( 18, 0 );
}</pre>
<p>Potential für Verbesserung sehe ich hier:</p>
<ul>
<li>Kreis und Kreuz nur je einmal zeichnen und wiederverwenden (siehe <a title="easeljs.com" href="http://easeljs.com/docs/Shape.html" target="_blank">Doku zu Shape</a>), statt jedes mal im Konstruktor.</li>
<li><a title="easeljs.com" href="http://easeljs.com/docs/DisplayObject.html" target="_blank">DisplayObject</a>.cache() verwenden.</li>
</ul>
<p>Meinungen?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2012/01/07/easeljs-lift-off-und-oop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EaselJS: Kickoff</title>
		<link>http://blog.crusy.net/2012/01/06/easeljs-kickoff/</link>
		<comments>http://blog.crusy.net/2012/01/06/easeljs-kickoff/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 22:25:14 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Easel]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[JS]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1839</guid>
		<description><![CDATA[So ein Blog ist ein tolles Spielzeug. Eigentlich wollte ich nur meine Tweets anzeigen. Dafür brauchte ich ein neues Theme (das alte hatte keine Sidebar^^). Das neue ist schick, aber hat da oben diesen grauen Header, für den ich eigentlich keine Verwendung habe&#8230; lange Rede, kurzer Sinn: Ich benutze es jetzt als Canvas für EaselJS, mit [...]]]></description>
			<content:encoded><![CDATA[<p>So ein Blog ist ein tolles Spielzeug. Eigentlich wollte ich nur meine <a title="Twitter für WordPress" href="http://blog.crusy.net/2012/01/05/twitter-fur-wordpress/">Tweets anzeigen</a>. Dafür brauchte ich ein <a title="inLine" href="http://inline.thomasgriffinmedia.com/" target="_blank">neues Theme</a> (das alte hatte keine Sidebar^^). Das neue ist schick, aber hat da oben diesen grauen Header, für den ich eigentlich keine Verwendung habe&#8230; lange Rede, kurzer Sinn: Ich benutze es jetzt als <a title="Wikipedia" href="http://de.wikipedia.org/wiki/Canvas_(HTML-Element)" target="_blank">Canvas</a> für <a title="EaselJS" href="http://easeljs.com/" target="_blank">EaselJS</a>, mit dem ich gerade rumspiele.</p>
<p>Mittelfristig möchte ich da random das anzeigen, was bei meinen Spielereien so abfällt. Bis auf weiteres muss es aber eine Abwandlung einer <a title="Getting Started with the Canvas Element and EaselJS" href="http://www.mikechambers.com/blog/2011/01/19/getting-started-with-the-canvas-element-and-easeljs/" target="_blank">Demo</a> von Mike Chambers tun.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2012/01/06/easeljs-kickoff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alternativen für Facebook-Posts aus Actionscript</title>
		<link>http://blog.crusy.net/2011/05/13/alternativen-fur-facebook-posts-aus-actionscript/</link>
		<comments>http://blog.crusy.net/2011/05/13/alternativen-fur-facebook-posts-aus-actionscript/#comments</comments>
		<pubDate>Fri, 13 May 2011 14:46:59 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Graph]]></category>
		<category><![CDATA[Open Graph]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1419</guid>
		<description><![CDATA[Wer mit der Facebook-API für Actionscript Posts absetzen will, kann das direkt machen: Facebook.api( &#8216;/me/feed&#8217;, _publishPostHandler, params, URLRequestMethod.POST ); oder als Javascript-Overlay: Facebook.ui( &#8216;feed&#8217;, data, null, null ); oder als Pop-Up Facebook.ui( &#8216;feed&#8217;, data, null, &#8216;popup&#8217; ); Das data-Object beinhaltet die in den Docs unter &#8220;Publishing&#8221; beschriebenen Parameter.]]></description>
			<content:encoded><![CDATA[<p>Wer mit der <a title="http://code.google.com/p/facebook-actionscript-api/" href="http://code.google.com/p/facebook-actionscript-api/" target="_blank">Facebook-API für Actionscript</a> Posts absetzen will, kann das direkt machen:</p>
<blockquote><p>Facebook.api( &#8216;/me/feed&#8217;, _publishPostHandler, params, URLRequestMethod.POST );</p></blockquote>
<p>oder als Javascript-Overlay:</p>
<blockquote><p>Facebook.ui( &#8216;feed&#8217;, data, null, null );</p></blockquote>
<p>oder als Pop-Up</p>
<blockquote><p>Facebook.ui( &#8216;feed&#8217;, data, null, &#8216;popup&#8217; );</p></blockquote>
<p>Das data-Object beinhaltet die <a title="https://developers.facebook.com/docs/reference/api/" href="https://developers.facebook.com/docs/reference/api/" target="_blank">in den Docs unter &#8220;Publishing&#8221;</a> beschriebenen Parameter.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2011/05/13/alternativen-fur-facebook-posts-aus-actionscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook Tab: Höhe eines iFrames (kein FBML!) setzen</title>
		<link>http://blog.crusy.net/2011/04/05/facebook-tab-hohe-eines-iframes-kein-fbml-setzen/</link>
		<comments>http://blog.crusy.net/2011/04/05/facebook-tab-hohe-eines-iframes-kein-fbml-setzen/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 13:14:28 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[App]]></category>
		<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Facebook App]]></category>
		<category><![CDATA[FBML]]></category>
		<category><![CDATA[iFrame]]></category>
		<category><![CDATA[Tab]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1353</guid>
		<description><![CDATA[Wenn man einen Facebook Tab in der Höhe ändern will (default ist 520&#215;800), dann findet man dazu einige Vorschläge im Netz. Die meisten gehen davon aus, dass der Tab in FBML angelegt ist, was er aber nicht mehr sein muss; stattdessen kann man auch einen simplen IFrame benutzen. Die Lösung, die in dem Fall für [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn man einen <a title="I AM A D5100" href="http://www.facebook.com/iamnikon?sk=app_196717260366388" target="_blank">Facebook Tab</a> in der Höhe ändern will (default ist 520&#215;800), dann findet man dazu einige Vorschläge im Netz. Die meisten gehen davon aus, dass der Tab in <a title="Facebook Markup Language" href="http://en.wikipedia.org/wiki/Fbml#Facebook_Markup_Language" target="_blank">FBML</a> angelegt ist, was er aber nicht mehr sein muss; stattdessen kann man auch einen simplen IFrame benutzen. <a title="http://stackoverflow.com/" href="http://stackoverflow.com/questions/4998519/setting-the-height-of-iframe-tabs-for-facebook-profile-pages" target="_blank">Die Lösung, die in dem Fall für mich funktioniert hat</a>:</p>
<blockquote><p>&lt;div id=&#8221;fb-root&#8221;&gt;&lt;/div&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;http://connect.facebook.net/en_US/all.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; charset=&#8221;utf-8&#8243;&gt;<br />
FB.Canvas.setSize();<br />
&lt;/script&gt;</p></blockquote>
<p>an das Ende des body hängen, also direkt vor &lt;/body&gt;. Wichtig: Der div &#8220;fb-root&#8221;. Viele Lösungen im Netz basieren offenbar darauf, dass ein solches Element schon da ist &#8211; was zumindest bei mir nicht der Fall war.</p>
<p>Ich habe für den body außerdem padding und margin auf 0, sowie overflow auf hidden und height auf die Höhe des IFrames gesetzt.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2011/04/05/facebook-tab-hohe-eines-iframes-kein-fbml-setzen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Youtube auf dem iPhone</title>
		<link>http://blog.crusy.net/2010/04/22/youtube-auf-dem-iphone/</link>
		<comments>http://blog.crusy.net/2010/04/22/youtube-auf-dem-iphone/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 10:53:21 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[swfobject]]></category>
		<category><![CDATA[Webstandard]]></category>
		<category><![CDATA[Youtube]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1029</guid>
		<description><![CDATA[Youtube empfiehlt zwar die Verwendung von swfobject, dann funktioniert&#8217;s aber nicht auf dem iPhone &#8211; man sieht nix. Es gibt aber tatsächlich (XHTML-valide) Möglichkeiten, zB diese hier auf Learning the world. Man sieht dann das Preview-Bild, das einem auch zB in der youtube-Suche angezeigt wird. Bei Klick darauf öffnet sich die Youtube-App. Mich würde allerdings [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.crusy.net/wp-content/uploads/2010/04/youtube-logo.png"><img class="aligncenter size-full wp-image-1030" title="youtube-logo" src="http://blog.crusy.net/wp-content/uploads/2010/04/youtube-logo.png" alt="" width="400" height="283" /></a></p>
<p>Youtube <a title="YouTube JavaScript Player API Reference" href="http://code.google.com/intl/de/apis/youtube/js_api_reference.html#Embedding" target="_blank">empfiehlt</a> zwar die Verwendung von <a title="swfobject" href="http://code.google.com/p/swfobject/" target="_blank">swfobject</a>, dann funktioniert&#8217;s aber nicht auf dem iPhone &#8211; man sieht nix. Es gibt aber tatsächlich (XHTML-valide) Möglichkeiten, zB diese hier <a title="Learning the world" href="http://learningtheworld.eu/2009/youtube-embed/" target="_blank">auf Learning the world</a>. Man sieht dann das Preview-Bild, das einem auch zB in der youtube-Suche angezeigt wird. Bei Klick darauf öffnet sich die Youtube-App.</p>
<p>Mich würde allerdings mal interessieren, was man sieht, wenn man sich die Youtube-Videos auf diesem meinen Blog mit dem iPhone ansieht&#8230; verdammter Mist. Wieso haben wir eigentlich den IE6 überstanden, nur damit nun die nächste Firma anfängt, dem Web seine Extrawürste aufzuzwingen?? m(</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2010/04/22/youtube-auf-dem-iphone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JSON Online Parser</title>
		<link>http://blog.crusy.net/2010/04/20/json-online-parser/</link>
		<comments>http://blog.crusy.net/2010/04/20/json-online-parser/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 14:36:17 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Online tool]]></category>
		<category><![CDATA[Parsen]]></category>
		<category><![CDATA[Parser]]></category>
		<category><![CDATA[Parsing]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1025</guid>
		<description><![CDATA[Einen Parser für JSON, mit brauchbareren Fehlermeldungen als der Firebug sie bietet, gibt es auf json.parser.online.fr.]]></description>
			<content:encoded><![CDATA[<p>Einen Parser für JSON, mit brauchbareren Fehlermeldungen als der Firebug sie bietet, gibt es auf <a title="JSON Parser" href="http://json.parser.online.fr/" target="_blank">json.parser.online.fr</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2010/04/20/json-online-parser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Abgerundete Ecken</title>
		<link>http://blog.crusy.net/2009/07/10/abgerundete-ecken/</link>
		<comments>http://blog.crusy.net/2009/07/10/abgerundete-ecken/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 14:48:15 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[abgerundet]]></category>
		<category><![CDATA[abgerundete Ecken]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[round]]></category>
		<category><![CDATA[rounded corners]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=807</guid>
		<description><![CDATA[Wer abgerundete Ecken auf seiner Webseite will, und keine Lust auf Photoshop-Orgien hat (oder CSS3 verwenden will^^), sollte sich mal die Corner Demo für jQuery ansehen. Danke an Moritz, once again!]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-808" title="rounded_corners" src="http://blog.crusy.net/wp-content/uploads/2009/07/rounded_corners.png" alt="rounded_corners" width="286" height="136" /></p>
<p>Wer abgerundete Ecken auf seiner Webseite will, und keine Lust auf Photoshop-Orgien hat (<a title="css3 preview" href="http://www.css3.info/preview/rounded-border/" target="_blank">oder CSS3 verwenden</a> will^^), sollte sich mal die <a title="jQuery Corner Demo" href="http://malsup.com/jquery/corner/" target="_blank">Corner Demo</a> für <a title="jQuery" href="http://jquery.com/" target="_blank">jQuery</a> ansehen. Danke an Moritz, once again!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2009/07/10/abgerundete-ecken/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XMLHttpRequest.responseText mit XML *und* Javascript [UPDATE]</title>
		<link>http://blog.crusy.net/2009/04/29/xmlhttprequestresponsetext-mit-xml-und-javascript/</link>
		<comments>http://blog.crusy.net/2009/04/29/xmlhttprequestresponsetext-mit-xml-und-javascript/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 15:26:00 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Extjs]]></category>
		<category><![CDATA[HTTPRequest]]></category>
		<category><![CDATA[Voodoo]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=747</guid>
		<description><![CDATA[&#8220;Normalerweise&#8221; besteht so ein responseText aus einem XML-Fragment. Das baut man dann dynamisch in seine Seite und gut ist. Javascript wird dabei nicht mehr ausgeführt. Ein Trick zum dynamischen Abrufen (und Ausführen) von JS besteht darin, dass der responseText an eval() übergeben und so ausgeführt wird&#8230; dazu muss der responseText aber natürlich reines JS sein. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-748" title="ajax" src="http://blog.crusy.net/wp-content/uploads/2009/04/ajax.jpg" alt="ajax" width="300" height="404" /></p>
<p>&#8220;Normalerweise&#8221; besteht so ein responseText aus einem XML-Fragment. Das baut man dann dynamisch in seine Seite und gut ist. Javascript wird dabei nicht mehr ausgeführt.</p>
<p>Ein Trick zum dynamischen Abrufen (und Ausführen) von JS besteht darin, dass der responseText an <a title="eval()" href="http://www.w3schools.com/jsref/jsref_eval.asp" target="_blank">eval()</a> übergeben und so ausgeführt wird&#8230; dazu muss der responseText aber natürlich reines JS sein.</p>
<p>Wenn man nun aber <strong>beides</strong> will, so erzeuge man einen responseText a la</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221; id=&#8221;theScript&#8221;&gt;<br />
alert( &#8216;yeah&#8217; );<br />
&lt;/script&gt;<br />
&lt;div id=&#8221;theContent&#8221;&gt;&#8230;&lt;/div&gt;</p></blockquote>
<p>und voila (hier am Beispiel von <a title="ExtJS" href="http://extjs.com/products/extjs/" target="_blank">ExtJS</a>):</p>
<blockquote><p>var ajaxRequest = Ext.Ajax.request<br />
({<br />
url: &#8216;index.php?fooBar,<br />
params: {},<br />
disableCaching: false,<br />
success: onResponseDoMe,<br />
failure: function(){}<br />
});</p></blockquote>
<p>hier nun der Zauber:</p>
<blockquote><p>function onResponseDoMe( xhr )<br />
{<br />
var newContent = xhr.responseText;<br />
Ext.get(&#8216;targetDiv&#8217;).update(newContent);<br />
eval( Ext.get(&#8216;theScript&#8217;).dom.innerHTML );<br />
}</p></blockquote>
<p>Der Trick ist also einfach: Packe das JS in einen &lt;script&gt;-Knoten, und gebe diesem eine ID, um darauf zugreifen zu können <img src='http://blog.crusy.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>NACHTRAG: In ExtJS kann man natürlich auch einfach den Parameter <code>loadScripts</code> von <code>Ext.Element.update()</code> nutzen <img src='http://blog.crusy.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2009/04/29/xmlhttprequestresponsetext-mit-xml-und-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Firefox] ExternalInterface.call() von außerhalb &#8220;der Bühne&#8221;</title>
		<link>http://blog.crusy.net/2009/04/29/firefox-externalinterfacecall-von-auserhalb-der-buhne/</link>
		<comments>http://blog.crusy.net/2009/04/29/firefox-externalinterfacecall-von-auserhalb-der-buhne/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 08:59:12 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS]]></category>
		<category><![CDATA[ExternalInterface]]></category>
		<category><![CDATA[JS]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=742</guid>
		<description><![CDATA[Man liest von ExternalInterface-Problemen, die darauf basieren, dass von Javascript aus AS-Funktionen aufgerufen werden, bevor das SWF geladen ist &#8211; etwa bei onLoad. Als Lösung gilt: &#8220;Rufe aus dem SWF heraus eine JS-Funktion auf. Dann (und erst dann) weiß JS, dass das SWF bereit ist.&#8221; So weit, so gut. Was man dazu wissen muss, und [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-103" title="firefox" src="http://blog.crusy.net/wp-content/uploads/2008/08/firefox.png" alt="firefox" width="300" height="289" /></p>
<p>Man liest von <a title="ExternalInterface" href="http://livedocs.adobe.com/flash/9.0_de/ActionScriptLangRefV3/flash/external/ExternalInterface.html" target="_blank">ExternalInterface</a>-Problemen, die darauf basieren, dass von Javascript aus AS-Funktionen aufgerufen werden, bevor das SWF geladen ist &#8211; etwa bei onLoad. Als Lösung gilt: &#8220;Rufe aus dem SWF heraus eine JS-Funktion auf. Dann (und erst dann) weiß JS, dass das SWF bereit ist.&#8221;</p>
<p>So weit, so gut.</p>
<p>Was man dazu wissen muss, und was man deutlich weniger schnell findet im Netz: Ein SWF, das außerhalb des sichtbaren Bereiches liegt (etwa bei &#8220;position: absolute; top: -10px; left: -10px;&#8221;), ruft im Firefox 3/Windows keine ExternalInterface-Funktion auf. Gar keine, nie. Obwohl ExternalInterface.available true ist, und obwohl das SWF eigentlich angezeigt wird.</p>
<p>HTH.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2009/04/29/firefox-externalinterfacecall-von-auserhalb-der-buhne/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Der Neckar regelt.</title>
		<link>http://blog.crusy.net/2008/12/23/der-neckar-regelt/</link>
		<comments>http://blog.crusy.net/2008/12/23/der-neckar-regelt/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 20:00:33 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Werbung]]></category>
		<category><![CDATA[Adressleiste]]></category>
		<category><![CDATA[ASCII]]></category>
		<category><![CDATA[Jung von Matt Nekar]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=464</guid>
		<description><![CDATA[The Neckar rulez: Guckst Du hier (funktioniert nur in neuesten Browsern)]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><object width="400" height="300" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=2574227&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed width="400" height="300" type="application/x-shockwave-flash" src="http://vimeo.com/moogaloop.swf?clip_id=2574227&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowfullscreen="true" allowscriptaccess="always" /></object></p>
<p><a title="JvM Neckar" href="http://blog.jvm-neckar.de/2008/12/19/kleine-raten-kleine-werbung-die-animierte-url/" target="_blank">The Neckar rulez</a>: Guckst Du <a title="www.mietwagen.de/sixt" href="http://www.mietwagen.de/sixt/" target="_blank">hier </a>(funktioniert nur in neuesten Browsern)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2008/12/23/der-neckar-regelt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

