<?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>TimeWaster's Place &#187; javascript</title>
	<atom:link href="http://www.timewaster.de/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.timewaster.de</link>
	<description>Programming, Design, Tekkie Stuff and more</description>
	<lastBuildDate>Wed, 04 Aug 2010 14:02:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HTML 5 &#8211; The future starts now</title>
		<link>http://www.timewaster.de/html-5-the-future-starts-now/</link>
		<comments>http://www.timewaster.de/html-5-the-future-starts-now/#comments</comments>
		<pubDate>Mon, 17 May 2010 11:55:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ogg]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[w3c]]></category>

		<guid isPermaLink="false">http://www.timewaster.de/?p=313</guid>
		<description><![CDATA[This is very much the first project i have done out of curiosity instead of boredom:

An HTML 5 video player with a nice tile repeation effect.
It is mostly a performance test for HTML5&#8217;s new Video and Canvas tags allowing you to manipulate pictures and other picture related sources like videos in real time with nothing [...]]]></description>
			<content:encoded><![CDATA[<p>This is very much the first project i have done out of curiosity instead of boredom:</p>
<p><a href="http://www.viiideeeooo.de/"><img src="http://www.viiideeeooo.de/preview.jpg" alt="Viiideeeooo.de" /></a><br />
An HTML 5 video player with a nice tile repeation effect.</p>
<p>It is mostly a performance test for HTML5&#8217;s new Video and Canvas tags allowing you to manipulate pictures and other picture related sources like videos in real time with nothing more than HTML and Javascript!</p>
<p>YES, NO FLASH IS INVOLVED!!!</p>
<p>Please don&#8217;t get me wrong: I really like Flash and imho it will never die because it can do much more application like things than HTML5 (for instance: <a href="http://www.audiotool.com/app">A real time Sequencer and Synthesizer</a> or <a href="http://www.splashup.com/splashup/">a complete Picture Editing Suite</a>). </p>
<p>But seeing done such monitor filling animations in HTML5 is really nice.</p>
<p><a href="http://www.viiideeeooo.de/">So check it out and enjoy a whole new video experience on Viiideeeooo.de!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.timewaster.de/html-5-the-future-starts-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The smallest AJAX framework ever</title>
		<link>http://www.timewaster.de/the-smallest-ajax-framework-ever/</link>
		<comments>http://www.timewaster.de/the-smallest-ajax-framework-ever/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 22:41:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programmierung]]></category>

		<guid isPermaLink="false">http://www.timewaster.de/?p=172</guid>
		<description><![CDATA[The most AJAX frameworks are bloated with many functions you&#8217;ll never use or need. Who wants 60 KB of JavaScript if your only need is to send and load data? I Don&#8217;t.
I have found somewhere a short howto for AJAX, and derived (rewritten) the smallest AJAX framework ever out of it:
var ajax = false;
if(window.XMLHttpRequest) ajax [...]]]></description>
			<content:encoded><![CDATA[<p>The most AJAX frameworks are bloated with many functions you&#8217;ll never use or need. Who wants 60 KB of JavaScript if your only need is to send and load data? I Don&#8217;t.</p>
<p>I have found somewhere a short howto for AJAX, and derived (rewritten) the smallest AJAX framework ever out of it:</p>
<pre><code>var ajax = false;
if(window.XMLHttpRequest) ajax = new XMLHttpRequest();
else if(window.ActiveXObject) {
	try { ajax = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) {
		try { ajax = new ActiveXObject("Microsoft.XMLHTTP"); }
		catch (e) {}
	}
}

function ajaxGetContent(type, url, parameter, output_function) {
	if(!ajax) eval(output_function + '(false);');
	ajax.onreadystatechange = function() {
		if(output_function != 'void' &#038;&#038; ajax.readyState == 4) {
			if(ajax.status == 200) eval(output_function + '(ajax.responseText);');
			else eval(output_function + '(false);');
		}
	}
	if(type == "post") {
		ajax.open('POST', url, true);
		ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		ajax.send(parameter);
	} else {
		ajax.open('GET', url + ((parameter.length > 0)?"?":"") + parameter, true);
		ajax.send(null);
	}
}</code></pre>
<p>That&#8217;s short, isn&#8217;t it?</p>
<p>To get the data you want you have to simply call the function and define a function which will be called after the data arrives:</p>
<pre><code>ajaxGetContent('post', '/myURL/index.php', 'a=b', 'myDataCallBack');

function myDataCallBack(myContent) {
	if(myContent == false) {
		// something went wrong
	} else {
		// have fun with your data
	}
}</code></pre>
<p>And if you want to send data only and don&#8217;t care of the answer, use this syntax:</p>
<pre><code>ajaxGetContent('post', '/myURL/index.php', 'a=b', 'void');</code></pre>
<p>Some explanation:<br />
- type = How to send the data (Parameters). &#8220;post&#8221; or &#8220;get&#8221;.<br />
- url = Where to send it to.<br />
- parameter = URL-style parameters. Never use a question mark!<br />
- output_function = The function which will be called after the data is received.</p>
<p>This Tool is tested in Opera 9+10, Firefox 2+3 and MSIE 7+8.</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.timewaster.de/the-smallest-ajax-framework-ever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIV layer with 100% height, the Javascript way</title>
		<link>http://www.timewaster.de/div-layer-with-100-height-the-javascript-way/</link>
		<comments>http://www.timewaster.de/div-layer-with-100-height-the-javascript-way/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 19:56:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[size]]></category>

		<guid isPermaLink="false">http://www.timewaster.de/?p=159</guid>
		<description><![CDATA[When you create a div layer with 100% width and height, the height is always only the height of the browser window, not of the page content (which can be much higher).
To solve this, give the layer div an id and use the following JS code inside the layer div:
&#60;script type="text/javascript"&#62;document.getElementById("yourlayerid").style.height = document.getElementsByTagName("body")[0].offsetHeight + &#34;px&#34;;&#60;/script&#62;
The [...]]]></description>
			<content:encoded><![CDATA[<p>When you create a div layer with 100% width and height, the height is always only the height of the browser window, not of the page content (which can be much higher).</p>
<p>To solve this, give the layer div an id and use the following JS code inside the layer div:</p>
<p><code>&lt;script type="text/javascript"&gt;document.getElementById("yourlayerid").style.height = document.getElementsByTagName("body")[0].offsetHeight + &quot;px&quot;;&lt;/script&gt;</code></p>
<p>The code is very simple, it gets the height of the content (the body element) and gives it the layer div.</p>
<p>Tested in Opera, Firefox and *barf* MSIE (8).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.timewaster.de/div-layer-with-100-height-the-javascript-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On-the-fly Picture Swapping, how to get it work in MSIE</title>
		<link>http://www.timewaster.de/on-the-fly-picture-swapping-how-to-get-it-work-in-msie/</link>
		<comments>http://www.timewaster.de/on-the-fly-picture-swapping-how-to-get-it-work-in-msie/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 13:53:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[msie]]></category>
		<category><![CDATA[picture]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[swapping]]></category>

		<guid isPermaLink="false">http://www.timewaster.de/?p=146</guid>
		<description><![CDATA[To swap or reload a picture on the fly is easy with Javascript. Just give the img tag a unique id and execute the following command in javascript:
document.getElementById("picture").src = "/img/cool-picture.jpg";
Now comes the glitch in (guess where) Internet Explorer: If you want to reload a picture that has changed on the server (let&#8217;s say you have [...]]]></description>
			<content:encoded><![CDATA[<p>To swap or reload a picture on the fly is easy with Javascript. Just give the img tag a unique id and execute the following command in javascript:</p>
<p><code>document.getElementById("picture").src = "/img/cool-picture.jpg";</code></p>
<p>Now comes the glitch in (guess where) Internet Explorer: If you want to reload a picture that has changed on the server (let&#8217;s say you have overwritten the picture with a php gd-lib script in the background), the Internet Explorer (i call him msie, spoken &#8220;emsy&#8221;) always keeps the cached picture instead of reloading the picture from the server like opera and firefox do.<br />
You can fix this behaviour with a simple cache-avoiding technique: Add a random number as a parameter, as shown in the following code, that&#8217;s it.</p>
<p><code>document.getElementById("picture").src = "/img/cool-picture.jpg?r=" + Math.floor(Math.random() * 1000);</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.timewaster.de/on-the-fly-picture-swapping-how-to-get-it-work-in-msie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
