<?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>Graphic Euphoria&#187; Javascript</title>
	<atom:link href="http://www.graphic-euphoria.co.uk/category/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.graphic-euphoria.co.uk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 12 Oct 2009 14:57:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Firefox not displaying dynamically embedded flash? Page-speed might be your problem!</title>
		<link>http://www.graphic-euphoria.co.uk/firefox-not-displaying-dynamically-embedded-flash-page-speed-might-be-your-problem</link>
		<comments>http://www.graphic-euphoria.co.uk/firefox-not-displaying-dynamically-embedded-flash-page-speed-might-be-your-problem#comments</comments>
		<pubDate>Mon, 12 Oct 2009 14:55:35 +0000</pubDate>
		<dc:creator>Si</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://www.graphic-euphoria.co.uk/?p=298</guid>
		<description><![CDATA[Flash no show Today i discovered a worrying bug with Firefox, Firebug and Page-speed.  A good friend of mine, Chris Murray, was demonstrating his new flash photo upload applet. I rudely pointed out that it didn&#8217;t work in Firefox only to find out that it did in his. After wasting his time trying to prove [...]]]></description>
			<content:encoded><![CDATA[<h2>Flash no show</h2>
Today i discovered a worrying bug with <strong><a title="visit firefox's site and download it please!" href="http://www.mozilla.com/firefox/" target="_blank">Firefox</a></strong>, <strong><a title="download and install firebug" href="https://addons.mozilla.org/en-US/firefox/addon/1843" target="_blank">Firebug </a></strong>and <strong><a title="visit the page-speed website. It is very good!" href="http://code.google.com/speed/page-speed/" target="_blank">Page-speed</a></strong>.  A good friend of mine, <a title="Visit Chris Murrays personal portfolio site" href="http://www.chrismurray.me.uk/" target="_blank">Chris Murray</a>, was demonstrating his new <strong>flash</strong> photo upload applet. I rudely pointed out that it didn&#8217;t work in <strong>Firefox </strong>only to find out that it did in his. After wasting his time trying to prove <strong>SWFOject</strong>, <strong>Firefox </strong>and maybe <strong>Flash </strong>needed to be updated it turns out that no <strong>dynamically embedded flash</strong> worked in my version of <strong>Firefox</strong>. Sorry Chris&#8230;

What do i mean by <strong>embedded flash</strong>? Well, to get round the various methods of e<strong>mbedding flash</strong> into multiple <strong>browsers</strong>, <strong>javascript </strong>is often used to insert the flash into the DOM. Thereby using different techniques per <strong>browser</strong>.

To cut a long story short here is a screenshot of the relevant flash:
<img class="alignnone size-full wp-image-299" title="pageSpeedFlash" src="http://www.graphic-euphoria.co.uk/uploads/2009/10/pageSpeedFlash.jpg" alt="pageSpeedFlash" width="600" height="250" />

As you can see, the mark up is correct and present, just strangely disabled.

I am using <strong>Firefox 3.5.3</strong>, F<strong>irebug 1.4.3</strong> and <strong>Page-speed 1.3</strong>. All are the updated and most recent versions.
<h3>What can you do?</h3>
Nothing really. The issue has been raised with <strong>Page-speed</strong> guys and there is a <a title="Visit the page-speed support forum" href="http://code.google.com/p/page-speed/issues/detail?id=137" target="_blank">support thread</a> too. I expect this to be resolved straight away as the issue has been marked critical. It is probably best to disable <strong>Page-speed</strong> for the time being. There is always <strong><a title="visit the yslow website" href="http://developer.yahoo.com/yslow/" target="_blank">Yslow</a></strong>!<script src="http://feeds.feedburner.com/~s/sidonaldson?i=http://www.graphic-euphoria.co.uk/firefox-not-displaying-dynamically-embedded-flash-page-speed-might-be-your-problem" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://www.graphic-euphoria.co.uk/firefox-not-displaying-dynamically-embedded-flash-page-speed-might-be-your-problem/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Seperate a number (int) from string using Mootools</title>
		<link>http://www.graphic-euphoria.co.uk/seperate_a_number_from_a_sting_using_mootool</link>
		<comments>http://www.graphic-euphoria.co.uk/seperate_a_number_from_a_sting_using_mootool#comments</comments>
		<pubDate>Wed, 09 Sep 2009 10:58:37 +0000</pubDate>
		<dc:creator>Si</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://www.graphic-euphoria.co.uk/?p=295</guid>
		<description><![CDATA[I recently blogged about using regular expressions to extract a number or integer from a string in javascript. So what if you are using Mootools? Well you save even more time: //only works for a string beginning with a number! ('123 Hello World').toInt(); //=&#62; '123' Mootools FTW!]]></description>
			<content:encoded><![CDATA[I recently blogged about <a href="http://www.graphic-euphoria.co.uk/seperate-a-number-int-from-a-string-in-javascript" title="using regular expressions to extract a number or integer from a string in javascript">using regular expressions to extract a number or integer from a string in javascript</a>. So what if you are using <a href="http://mootools.net/" target="_blank" title="Mootools, a compact javascript framework">Mootools</a>? Well you save even more time:



<pre name="code" class="javascript">
//only works for a string beginning with a number!
('123 Hello World').toInt();  //=&gt; '123'
</pre>

<a href="http://mootools.net/" target="_blank" title="Mootools, a compact javascript framework">Mootools</a> FTW!

<script src="http://feeds.feedburner.com/~s/sidonaldson?i=http://www.graphic-euphoria.co.uk/seperate_a_number_from_a_sting_using_mootool" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://www.graphic-euphoria.co.uk/seperate_a_number_from_a_sting_using_mootool/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seperate a number (int) from a string in Javascript</title>
		<link>http://www.graphic-euphoria.co.uk/seperate-a-number-int-from-a-string-in-javascript</link>
		<comments>http://www.graphic-euphoria.co.uk/seperate-a-number-int-from-a-string-in-javascript#comments</comments>
		<pubDate>Tue, 08 Sep 2009 22:40:37 +0000</pubDate>
		<dc:creator>Si</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.graphic-euphoria.co.uk/?p=289</guid>
		<description><![CDATA[Seperating a number or integer from a string is a common task in any coding language. I was in the middle of some mootool'in and i was about to go down the usual route when i rushed off to google a better way to do it. Thanks to stackoverflow i found it. Regular expressions!]]></description>
			<content:encoded><![CDATA[Seperating a <strong>number </strong>or <strong>integer </strong>from a <strong>string </strong>is a common task in any coding language including <strong>javascript</strong>. It&#8217;s one of those times when you just wish code knew what you were trying to do&#8230;

Imagine you have a <strong>string</strong>:

<pre name="code" class="javascript">var myString = "123 Hello World";</pre>

I was in the middle of some mootool&#8217;in and i was about to go down the usual route of:

<pre name="code" class="javascript">var myNumber = myString.substring(0,myString.indexOf(' '));</pre>

when i rushed off to google a better way to do it. Thanks to <a href="http://stackoverflow.com/questions/609574/get-the-first-ints-in-a-string-with-javascript" target="_blank" title="check out stackoverflow">stackoverflow</a> i found it. <strong>Regular expressions</strong>! I have no idea how to write them but i can appreciate them. The following expressions get the first integer within a string:

<pre name="code" class="javascript">("123 Hello World 4").replace(/(^\d+)(.+$)/i,'$1'); //=&gt; '123'

//If it's somewhere in the string:

(" Hello 123 World4").replace( /(^.+)(\w\d+\w)(.+$)/i,'$2'); //=&gt; '123'

//And for a number between characters:

("Hello123World 4").replace( /(^.+\D)(\d+)(\D.+$)/i,'$2'); /=&gt; '123''</pre>

Good stuff!<script src="http://feeds.feedburner.com/~s/sidonaldson?i=http://www.graphic-euphoria.co.uk/seperate-a-number-int-from-a-string-in-javascript" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://www.graphic-euphoria.co.uk/seperate-a-number-int-from-a-string-in-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detect Internet Explorer 6 (IE6) and other popular browsers with Mootools</title>
		<link>http://www.graphic-euphoria.co.uk/detect-internet-explorer-6-ie6-and-other-popular-browsers-with-mootools</link>
		<comments>http://www.graphic-euphoria.co.uk/detect-internet-explorer-6-ie6-and-other-popular-browsers-with-mootools#comments</comments>
		<pubDate>Thu, 09 Jul 2009 11:43:26 +0000</pubDate>
		<dc:creator>Si</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://www.graphic-euphoria.co.uk/?p=280</guid>
		<description><![CDATA[Mootools is a great, stable, open source javascript library which is maintained by a limited number of proffesional developers. It does have a browser detection class built in but it doesn't natively provide a method to detect the version of Internet Explorer.]]></description>
			<content:encoded><![CDATA[One of the top keyword searches on this blog is &#8216;<strong>detect ie6 mootools</strong>&#8216;; As popular as this search term is, it&#8217;s not actually covered, so this post should fill that gap!

<a title="visit mootools.net" href="http://mootools.net/" target="_blank">Mootools </a>is a great, <strong>stable</strong>, <strong>open source javascript librar</strong>y which is maintained by a limited number of proffesional developers. It does have a <strong>browser detection</strong> class built in but it doesn&#8217;t natively provide a method to detect the version of <strong>Internet Explorer</strong>.

The <strong>Mootools </strong>developers are code purists; Extending their browser class would be easy but they do not want to do it. They do provide a method to get the <strong>browser </strong>build and this could be used along with the remaining <strong>browser </strong>string to work out the version. Essentially, they like to keep their code relevant and streamlined.

In a previous post i covered how to <strong><a title="how to detect IE6 with one line of javascript" href="http://www.graphic-euphoria.co.uk/detect-all-versions-of-internet-explorer-6" target="_self">detect IE6</a></strong><a title="how to detect IE6 with one line of javascript" href="http://www.graphic-euphoria.co.uk/detect-all-versions-of-internet-explorer-6" target="_self"> with one line of </a><strong><a title="how to detect IE6 with one line of javascript" href="http://www.graphic-euphoria.co.uk/detect-all-versions-of-internet-explorer-6" target="_self">Javascript</a></strong>. This solves the problem where later builds of <strong>IE6</strong> can show a browser string similar to <strong>IE7</strong>.

This can be combined with the <strong>Mootools </strong>browser class to produce browser variables.
<pre name="code" class="javascript">//declare global variables
var WEBKIT = Browser.Engine.webkit;
var GECKO = Browser.Engine.gecko;
var OPERA = Browser.Engine.presto;
var IE = Browser.Engine.trident;
var IE6 = (navigator.userAgent.toLowerCase().indexOf('msie 6') != -1)
&amp;&amp; (navigator.userAgent.toLowerCase().indexOf('msie 7') == -1);

//test variables (delete)
if(WEBKIT) alert("WEBKIT");
if(GECKO) alert("GECKO");
if(OPERA) alert("OPERA");
if(IE) alert("IE");
if(IE6) alert("IE6");</pre>
Placing this code at the top of your <strong>JavaScript </strong>include will give you simple global  <strong>boolean </strong>variables for each <strong>browser </strong>platform. Creating one variable per <strong>browser </strong>at the very start means the calls to the <strong>browser </strong>class are limited to one and the detection script is ran only once. It also means you have very simple and easy to remember variables to use throughout your code.<script src="http://feeds.feedburner.com/~s/sidonaldson?i=http://www.graphic-euphoria.co.uk/detect-internet-explorer-6-ie6-and-other-popular-browsers-with-mootools" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://www.graphic-euphoria.co.uk/detect-internet-explorer-6-ie6-and-other-popular-browsers-with-mootools/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Google Analyitics &#8211;  fix the &#8216;_gat&#8217; is undefined problem in IE6 with Mootools</title>
		<link>http://www.graphic-euphoria.co.uk/google-analyitics-fix-the-_gat-is-undefined-problem-in-ie6-with-mootools</link>
		<comments>http://www.graphic-euphoria.co.uk/google-analyitics-fix-the-_gat-is-undefined-problem-in-ie6-with-mootools#comments</comments>
		<pubDate>Mon, 02 Mar 2009 14:03:12 +0000</pubDate>
		<dc:creator>Si</dc:creator>
				<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://www.graphic-euphoria.co.uk/?p=196</guid>
		<description><![CDATA[Google Analytics is a fantastic, totally free, web tracking service provided by Google. It works by embedding a javascript include at the bottom of your page which loads Google's tracking code. The code then passes all your tracking information to the Anaylitics cloud where it is digested and returned in the web-app.
The Problem

The code has to be included just before your closing body tag, this is because Google doesnt want to hold up your page loading while it crunches this data, by placing it there it guarentees 99% of your page has finished loading. This works perfectly in almost all cases but there have been exceptions. The only time i have come across a problem was when i was testing a site on Internet Explorer 6. I kept recieving this error: '_gat' is undefined]]></description>
			<content:encoded><![CDATA[<strong>Google Analytics</strong> is a fantastic, totally free, <strong>web tracking</strong> service provided by <strong>Google</strong>. It works by embedding a <strong>Javascript </strong>include at the bottom of your page which loads Google&#8217;s tracking code. The code then passes all your tracking information to the <strong>Analytics cloud</strong> where it is digested and returned in the <strong>web-app</strong>.
<h3>The Problem</h3>
The code has to be included just before your closing body tag, this is because Google doesn&#8217;t want to hold up your page loading while it crunches this data, by placing it there it guarantees 99% of your page has finished loading. This works perfectly in almost all cases but there have been exceptions. The only time i have come across a problem was when i was testing a site on <strong>Internet Explorer 6</strong>. I kept receiving this error:
<pre>'_gat' is undefined</pre>
This can only be created when the code tries to call the <strong>Analytics </strong>code before it is launched. Basically, it&#8217;s is trying to call the function _gat too soon. Google have tried to fix this by adding a <strong>Javascript </strong>&#8216;try&#8217; function.
<pre name="code" class="html">&lt;script type="text/javascript"&gt;
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
	try {
		var pageTracker = _gat._getTracker("UX-XXXXXX-X");
		pageTracker._trackPageview();
	} catch(err) {}
&lt;/script&gt;</pre>
This helps as the code &#8216;tries&#8217; to run the function and if it can&#8217;t then it runs the catch command. This works because it doesn&#8217;t create any other errors and the site will continue operating normally. The only problem is no tracking information will be passed.
<h4>Fixing it with Mootools</h4>
Firstly, more and more websites are using <strong>Javascript </strong>to provide better <strong>interactivity </strong>and <strong>functionality </strong>so there is a good chance you are already using a <strong>library </strong>in your site. Secondly they provide <strong>core functions</strong> which can detect when the page&#8217;s DOM is ready and when the page itself has actually finished loading. There a couple of things that can improved by converting this code to use a popular <strong>Javascript </strong>framework such as <strong>Mootools</strong>. Page load speed should be improved as we try to insert the tracking code after the page has completely finished loading and has been initiated. As a result we can also hope to improve the code performance by making sure the code has been downloaded before trying to run it.

Using <strong>Mootools </strong>we simply add a new <strong>Javascript </strong>assets into the page using the &#8216;addEvent&#8217; function and then run the <strong>analyitics </strong>function calls when it has loaded.
<pre name="code" class="javascript">
window.addEvent('load', function() {
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	new Asset.javascript(gaJsHost + "google-analytics.com/ga.js", {
		onload: function() {
			try {
			var pageTracker = _gat._getTracker("UX-XXXXXX-X");
			pageTracker._trackPageview();
			} catch(err) {}
		}
	});
});</pre>
As you can see, I have left the try function in, this is to protect against the same problem we faced initially. Only this time the chance of it happening has greatly reduced. Another benefit of using this method is that you can remove the tracking code from your HTML template or masterpage. Now it is simply added into your <strong>Javascript </strong>include instead. If you use <strong>analytics </strong>to track your <strong>AJAX </strong>calls then it helps that all your code is in the same place!

I hope you find this useful, please leave a comment if you know of any improvements or think you know a better method.<script src="http://feeds.feedburner.com/~s/sidonaldson?i=http://www.graphic-euphoria.co.uk/google-analyitics-fix-the-_gat-is-undefined-problem-in-ie6-with-mootools" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://www.graphic-euphoria.co.uk/google-analyitics-fix-the-_gat-is-undefined-problem-in-ie6-with-mootools/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hows to draw a PSP in MS Paint &#8211; the good and the bad!</title>
		<link>http://www.graphic-euphoria.co.uk/how-to-draw-a-psp-in-ms-paint</link>
		<comments>http://www.graphic-euphoria.co.uk/how-to-draw-a-psp-in-ms-paint#comments</comments>
		<pubDate>Sun, 22 Feb 2009 12:58:41 +0000</pubDate>
		<dc:creator>Si</dc:creator>
				<category><![CDATA[Art and Design]]></category>
		<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.graphic-euphoria.co.uk/?p=140</guid>
		<description><![CDATA[TechEBlog posted another great video where a skilled digital artist draws a Sony PSP by hand in MS Paint.

Yes, MS Paint, that well known digital creative tool. It rivals an etch-o-sketch in advanced technology!

Surprisingly it turns out quite well. The artist is obviously very talented and spent a long time on it.]]></description>
			<content:encoded><![CDATA[<a title="visit techeblog.com" href="http://www.techeblog.com/index.php/tech-gadget/artist-draws-realistic-sony-psp-in-ms-paint&quot;" target="_blank">TechEBlog posted another great video where a skilled digital artist draws a Sony PSP by hand in MS Paint</a>.

Yes, <strong>MS Paint</strong>, that well known digital creative tool. It rivals an <strong>etch-o-sketch</strong> in advanced technology!

Surprisingly it turns out quite well. The <strong>artist </strong>is obviously very talented and spent a long time on it.

<object width="425" height="344" data="http://www.youtube.com/v/eFV9-RuVYRU&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/eFV9-RuVYRU&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object>

Then i did a quick search on <strong>youtube </strong>and found a whole host of copycat videos.

These ones are no way near as good but they have a certain charm about them. If you watch them you will soon see what i mean. This is why i love youtube!

<object width="425" height="344" data="http://www.youtube.com/v/OuUjisYPJX4&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/OuUjisYPJX4&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object>

<object width="425" height="344" data="http://www.youtube.com/v/6XqDdzo2PTc&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/6XqDdzo2PTc&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object>

<object width="425" height="344" data="http://www.youtube.com/v/HbSeweA6_hg&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/HbSeweA6_hg&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object>

<object width="425" height="344" data="http://www.youtube.com/v/QGqIvMhaAoo&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/QGqIvMhaAoo&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object>

<object width="425" height="344" data="http://www.youtube.com/v/2Rgb2CrBzfY&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/2Rgb2CrBzfY&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object>

<object width="425" height="344" data="http://www.youtube.com/v/tnpEgmWRfzc&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/tnpEgmWRfzc&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object>

<strong>Ascii art</strong> rocks!

<object width="425" height="344" data="http://www.youtube.com/v/1oorShB9QcY&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/1oorShB9QcY&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object>

and of course.. the best til last!

<object width="425" height="344" data="http://www.youtube.com/v/1BVsyYZSUz8&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/1BVsyYZSUz8&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object><script src="http://feeds.feedburner.com/~s/sidonaldson?i=http://www.graphic-euphoria.co.uk/how-to-draw-a-psp-in-ms-paint" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://www.graphic-euphoria.co.uk/how-to-draw-a-psp-in-ms-paint/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Detect ALL versions of internet explorer 6 with one line of javascript!</title>
		<link>http://www.graphic-euphoria.co.uk/detect-all-versions-of-internet-explorer-6</link>
		<comments>http://www.graphic-euphoria.co.uk/detect-all-versions-of-internet-explorer-6#comments</comments>
		<pubDate>Sat, 21 Feb 2009 20:27:26 +0000</pubDate>
		<dc:creator>Si</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[ie]]></category>

		<guid isPermaLink="false">http://www.graphic-euphoria.co.uk/?p=135</guid>
		<description><![CDATA[One of the projects i am currently working on required me to determine if the user's browser was Internet Explorer 6 or not.]]></description>
			<content:encoded><![CDATA[One of the projects i am currently working on required me to determine if the user&#8217;s <strong>browser </strong>was <strong>Internet Explorer 6</strong> or not. The website&#8217;s menu came slightly out of alignment by a few pixels. I would normally use a <strong>conditional statement</strong> to add extra <strong>CSS </strong>but since this was a <strong>javascript </strong>menu my choice was limited to one..

..change the variable by a couple of pixels!

After some quick googling i found a way of doing it by using the <strong>user-agent string</strong>.

<a title="visit the future of web design" href="http://www.thefutureoftheweb.com/blog/detect-ie6-in-javascript" target="_blank">The Future of the Web » Detect Internet Explorer 6 in JavaScript</a>

This seemed perfect until i read the comments and stumbled across something. I was already aware that there are several different versions of <strong>IE6 </strong>and <strong>IE7 </strong>in existance but i didn&#8217;t know that some IE7&#8242;s return &#8216;<strong>msie 6</strong>&#8216; as it&#8217;s user string. An oversight by Microsoft perhaps?

Thankfully the user who pointed this out also offered a solution. Kudos to <strong>James King</strong> (comment number 8)!
<pre name="code" class="javascript">var IE6 = (navigator.userAgent.toLowerCase().indexOf('msie 6') != -1)
 &amp;&amp; (navigator.userAgent.toLowerCase().indexOf('msie 7') == -1)</pre><script src="http://feeds.feedburner.com/~s/sidonaldson?i=http://www.graphic-euphoria.co.uk/detect-all-versions-of-internet-explorer-6" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://www.graphic-euphoria.co.uk/detect-all-versions-of-internet-explorer-6/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checklist for a Successful Website Launch</title>
		<link>http://www.graphic-euphoria.co.uk/checklist-for-a-successful-website-launch</link>
		<comments>http://www.graphic-euphoria.co.uk/checklist-for-a-successful-website-launch#comments</comments>
		<pubDate>Thu, 19 Feb 2009 00:01:55 +0000</pubDate>
		<dc:creator>Si</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Findability (SEO)]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[gzip]]></category>

		<guid isPermaLink="false">http://www.graphic-euphoria.co.uk/?p=126</guid>
		<description><![CDATA[Moxie.com have blogged a useful checklist. They list 13 steps you would do well to consider before launching a website to the world wide web!
I agree with all their points and can think of a couple extra..]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.e-moxie.com/resources/news/13-steps-to-a-successful-website-launch/"><img src="http://www.e-moxie.com/images/elogo.gif" alt="moxie.com" /></a></p>

<a title="visit moxie.com" href="http://www.e-moxie.com/resources/news/13-steps-to-a-successful-website-launch/" target="_blank">Moxie.com</a> have blogged a useful <strong>checklist</strong>. They list 13 steps you would do well to consider before <strong>launching </strong>a <strong>website </strong>to the <strong>world wide web</strong>!

<a title="visit moxie.com" href="http://www.e-moxie.com/resources/news/13-steps-to-a-successful-website-launch/" target="_blank">13 Steps to a Successful Website Launch via e-moxie.com</a>.

I agree with all their points and can think of a couple extra..

14. <strong>Gzip </strong>all your <strong>javascript </strong>(if supported by your server). Otherwise use a javascript <strong>compressor </strong>to shrink the code.

15. <strong>Compress </strong>all your <strong>CSS </strong>using a CSS compressor. Try to compile it into one file and with different <a title="css media types" href="http://www.graphic-euphoria.co.uk/combine-all-css-media-types-into-one-style-sheet" target="_self">media types for print and screen</a>.

16. Remove all your <strong>annotations </strong>from your code and insert a <strong>copywrite </strong>comment.

17. Run a <strong>broken link </strong>checking  site to find all the problem links.

18. Use a <strong>sitemap </strong>generator to create your <strong>sitemap.xml.</strong>

19. <strong>Verify </strong>your site with <a title="google webmaster tools site" href="http://www.google.com/webmasters/tools" target="_blank">google webmaster tools</a>.

20. Finally, don&#8217;t forget a <strong>favicon</strong>!

Wow, that&#8217;s seven more tips! I hope you find this useful.

more posts coming soon..<script src="http://feeds.feedburner.com/~s/sidonaldson?i=http://www.graphic-euphoria.co.uk/checklist-for-a-successful-website-launch" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://www.graphic-euphoria.co.uk/checklist-for-a-successful-website-launch/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript: Passing variables with setTimeout and getting it to work in Internet Explorer</title>
		<link>http://www.graphic-euphoria.co.uk/javascript-passing-variables-with-settimeout-and-getting-it-to-work-in-internet-explorer</link>
		<comments>http://www.graphic-euphoria.co.uk/javascript-passing-variables-with-settimeout-and-getting-it-to-work-in-internet-explorer#comments</comments>
		<pubDate>Thu, 12 Feb 2009 14:06:13 +0000</pubDate>
		<dc:creator>Si</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.graphic-euphoria.co.uk/?p=11</guid>
		<description><![CDATA[If you write any sort of Javascript code then you probably have come across this at some point. Passing a variable to a function triggered from setTimeout doesn’t work in IE. Luckily I stumbled across a widely unknown solution!]]></description>
			<content:encoded><![CDATA[<h2>The Problem</h2>
If you write any sort of <strong>Javascript </strong>code then you probably have come across this at some point. Passing a <strong>variable </strong>to a <strong>function </strong>triggered from <strong>setTimeout </strong>doesn’t work in <strong>IE</strong>. Luckily I stumbled across a widely unknown solution!

Normally you would use this:
<pre name="code" class="js">
setTimeout(“myFunction(‘“+variable+”’)”,1000);
</pre>
but you are meant to be able to use this:

<pre name="code" class="js">
setTimeout(myFunction,1000,variable);
</pre>

but frustratingly it doesn’t work in any version of <strong>Internet Explorer</strong>.
<h3>The Solution</h3>
Well, it is surprisingly simple. You just need to encase your function name in a ‘<strong>closure</strong>’. i.e. a function declaration. This is surprisingly similar to flash actionscript which is of course <strong>javascript </strong>based. Why didn’t I think of this before??

So you simply put:

<pre name="code" class="js">
setTimeout(function(){myFunction(variable); variable = null},1000);
</pre>

the ‘variable = null’ is to stop a <strong>memory leak</strong> as the variable is not deleted as it should be.

(thanks <a title="click to visit makemineatriple.com" href="http://www.makemineatriple.com/2007/10/passing-parameters-to-a-function-called-with-settimout/" target="_blank">makemineatriple</a>)<script src="http://feeds.feedburner.com/~s/sidonaldson?i=http://www.graphic-euphoria.co.uk/javascript-passing-variables-with-settimeout-and-getting-it-to-work-in-internet-explorer" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://www.graphic-euphoria.co.uk/javascript-passing-variables-with-settimeout-and-getting-it-to-work-in-internet-explorer/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
