<?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>Eklog &#187; JavaScript</title>
	<atom:link href="http://www.ekstasis.net/log/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ekstasis.net/log</link>
	<description></description>
	<lastBuildDate>Sun, 13 Sep 2009 21:21:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>XML imported images using jQuery</title>
		<link>http://www.ekstasis.net/log/2009/06/07/xml-imported-images-using-jquery/</link>
		<comments>http://www.ekstasis.net/log/2009/06/07/xml-imported-images-using-jquery/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 06:14:59 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.ekstasis.net/log/2009/07/19/xml-imported-images-using-jquery/</guid>
		<description><![CDATA[Here&#8217;s how to load images from any server using a simple XML files. Useful for giving clients or affiliates access to updating sites without changing the main code.
See it in action at: Loading images with XML &#38; jQuery

&#60;script type=&#34;text/javascript&#34;&#62;
	$(document).ready(function()
	{
	$.get(&#8217;myData.xml&#8217;, function(d)
	{
	$(&#8217;#list&#8217;).append(&#8217;&#60;dl id=&#34;list1Cont&#34; /&#62;&#8217;);
 $(d).find(&#8217;book&#8217;).each(function()
	{
	var $book = $(this); 
	var title = $book.attr(&#34;title&#34;);
	var linkurl = $book.attr(&#8217;linkurl&#8217;);
	var imageurl = [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how to load images from any server using a simple XML files. Useful for giving clients or affiliates access to updating sites without changing the main code.</p>
<p>See it in action at: <a href="http://xml.xmhell.com/loadXMLWithJquery/" title="click to view website">Loading images with XML &amp; jQuery</a><br />
<span id="more-84"></span></p>
<p>&lt;script type=&quot;text/javascript&quot;&gt;</p>
<p>	$(document).ready(function()<br />
	{<br />
	$.get(&#8217;myData.xml&#8217;, function(d)<br />
	{<br />
	$(&#8217;#list&#8217;).append(&#8217;&lt;dl id=&quot;list1Cont&quot; /&gt;&#8217;);</p>
<p> $(d).find(&#8217;book&#8217;).each(function()<br />
	{<br />
	var $book = $(this); <br />
	var title = $book.attr(&quot;title&quot;);<br />
	var linkurl = $book.attr(&#8217;linkurl&#8217;);</p>
<p>	var imageurl = $book.attr(&#8217;imageurl&#8217;);</p>
<p> var html = &#8216;&lt;dt&gt; &lt;img class=&quot;bookImage&quot; alt=&quot;&quot; src=&quot;&#8217; + imageurl + &#8216;&quot; /&gt;  &lt;span class=&quot;link&quot;&gt;&lt;a href=&quot;http://www.startriteshoes.com/childrens-shoes/&#8217; + linkurl + &#8216;&quot;&gt;&#8217; + title + &#8216;&lt;/a&gt;&lt;/span&gt;&lt;/dt&gt;&#8217; ;<br />
	//    html += &#8216;&lt;dd&gt;&#8217;;<br />
	// html += &#8216;&lt;dt class=&quot;title&quot;&gt;&#8217; + title + &#8216;&lt;/dt&gt;&#8217;;<br />
	//    html += &#8216;&lt;span class=&quot;link&quot;&gt;&lt;a href=&quot;http://www.startriteshoes.com/childrens-shoes/&#8217; + linkurl + &#8216;&quot;&gt;&#8217; + title + &#8216;&lt;/a&gt;&lt;/span&gt;&#8217;;<br />
	//    html += &#8216;&lt;/dd&gt;&#8217;;</p>
<p> $(&#8217;#list1Cont&#8217;).append($(html));</p>
<p> });<br />
	});</p>
<p>&nbsp;</p>
<p> $.get(&#8217;myData2.xml&#8217;, function(d)<br />
	{<br />
	$(&#8217;#list2&#8242;).append(&#8217;&lt;dl id=&quot;list2Cont&quot; /&gt;&#8217;);</p>
<p> $(d).find(&#8217;book&#8217;).each(function()<br />
	{<br />
	var $book = $(this); <br />
	var title = $book.attr(&quot;title&quot;);<br />
	var linkurl = $book.attr(&#8217;linkurl&#8217;);</p>
<p>	var imageurl = $book.attr(&#8217;imageurl&#8217;);</p>
<p> var html = &#8216;&lt;dt&gt; &lt;img class=&quot;bookImage&quot; alt=&quot;&quot; src=&quot;&#8217; + imageurl + &#8216;&quot; /&gt;  &lt;span class=&quot;link&quot;&gt;&lt;a href=&quot;http://www.startriteshoes.com/childrens-shoes/&#8217; + linkurl + &#8216;&quot;&gt;&#8217; + title + &#8216;&lt;/a&gt;&lt;/span&gt;&lt;/dt&gt;&#8217; ;<br />
	//    html += &#8216;&lt;dd&gt;&#8217;;<br />
	// html += &#8216;&lt;dt class=&quot;title&quot;&gt;&#8217; + title + &#8216;&lt;/dt&gt;&#8217;;<br />
	//    html += &#8216;&lt;span class=&quot;link&quot;&gt;&lt;a href=&quot;http://www.startriteshoes.com/childrens-shoes/&#8217; + linkurl + &#8216;&quot;&gt;&#8217; + title + &#8216;&lt;/a&gt;&lt;/span&gt;&#8217;;<br />
	//    html += &#8216;&lt;/dd&gt;&#8217;;</p>
<p> $(&#8217;#list2Cont&#8217;).append($(html));</p>
<p> });<br />
	});<br />
	});<br />
	&lt;/script&gt;</p>
<p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;<br />
	&lt;books&gt;<br />
&lt;book title=&quot;F1X&quot; imageurl=&quot;http://www.ekstasis.net/images/funpics/f1scx.jpg&quot; linkurl=&quot;7200_7/ELISE&quot;&gt;&lt;/book&gt;<br />
&lt;book title=&quot;Fly in my&quot; imageurl=&quot;http://www.ekstasis.net/images/funpics/fly_soup.jpg&quot; linkurl=&quot;2200_7/SPIN&quot;&gt;&lt;/book&gt;<br />
&lt;book title=&quot;Why the long face?&quot; imageurl=&quot;http://www.ekstasis.net/images/funpics/horse.jpg&quot; linkurl=&quot;3043_7/QUICK_STEP&quot;&gt;&lt;/book&gt;<br />
&lt;book title=&quot;Mornin&quot; imageurl=&quot;http://www.ekstasis.net/images/funpics/wake_up.jpg&quot; linkurl=&quot;2121_7/TRILOGY&quot;&gt;&lt;/book&gt;<br />
&lt;/books&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ekstasis.net/log/2009/06/07/xml-imported-images-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Behavioural separation and jQuery</title>
		<link>http://www.ekstasis.net/log/2009/05/11/behavioural-separation-and-jquery/</link>
		<comments>http://www.ekstasis.net/log/2009/05/11/behavioural-separation-and-jquery/#comments</comments>
		<pubDate>Mon, 11 May 2009 16:59:23 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.ekstasis.net/log/2009/05/11/behavioural-separation-and-jquery/</guid>
		<description><![CDATA[

I&#8217;ve created a presentation about unobtrusive jQuery.
Contents:

Progressive CSS
Progressive JavaScripting 
Unobtrustive JavaScript
Understand browsers and users
Event Delegation
Relationships
Maintenance
JQuery
JQuery &#038; XML

Here’s a download link: Behavioral separation and jQuery
]]></description>
			<content:encoded><![CDATA[<p><img align="left" src="/images/blog/logo_jquery.jpg" alt="jQuery" /><br />
<br/><br/><br />
I&#8217;ve created a presentation about unobtrusive jQuery.<br/><br />
Contents:</p>
<ul>
<li>Progressive CSS</li>
<li>Progressive JavaScripting </li>
<li>Unobtrustive JavaScript</li>
<li>Understand browsers and users</li>
<li>Event Delegation</li>
<li>Relationships</li>
<li>Maintenance</li>
<li>JQuery</li>
<li>JQuery &#038; XML</li>
</ul>
<p>Here’s a download link: <a href="/imports/unobtrusive-jquery.pdf" title="click to download" />Behavioral separation and jQuery</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ekstasis.net/log/2009/05/11/behavioural-separation-and-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using swf object version 2</title>
		<link>http://www.ekstasis.net/log/2009/01/28/using-swf-object-version-2/</link>
		<comments>http://www.ekstasis.net/log/2009/01/28/using-swf-object-version-2/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 17:22:17 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.ekstasis.net/log/2009/01/28/using-swf-object-version-2/</guid>
		<description><![CDATA[swfobject is a great tool for serving flash in a standards-based, accessible way.
Version 2.1 is available at google code &#8211; here&#8217;s the link: code.google.com/p/swfobject/
Main Advantages:

It&#8217;s more optimized and flexible than any other Flash Player embed method around.
It uses unobtrusive JavaScript.
It offers a standards-based, accessible way to serve flash.
It allows you to avoid click-to-activate mechanisms to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>swfobject</strong> is a great tool for serving flash in a standards-based, accessible way.</p>
<p>Version 2.1 is available at google code &#8211; here&#8217;s the link: <a href="http://code.google.com/p/swfobject/">code.google.com/p/swfobject/</a></p>
<h2>Main Advantages:</h2>
<ul>
<li>It&#8217;s more optimized and flexible than any other Flash Player embed method around.</li>
<li>It uses unobtrusive JavaScript.</li>
<li>It offers a standards-based, accessible way to serve flash.</li>
<li>It allows you to avoid click-to-activate mechanisms to activate active content in Internet Explorer 6/7 and Opera 9+.</li>
</ul>
<p>There are two publishing methods: static publishing method &amp; dynamic publishing method.<br />
<span id="more-67"></span><br />
Both methods allow you to use standards-based markup and a way to serve alternative content (including a option to install / upgrade your flash) if flash isn&#8217;t supported.</p>
<p>The main advantage of the static publishing method is: If you have the Flash plug-in installed, but have JavaScript disabled or a use a browser that doesn&#8217;t support JavaScript, you will still be able to see your Flash content.</p>
<p>Usually there&#8217;s a good reason why JavaScript isn&#8217;t supported. <a href="http://www.w3schools.com/browsers/browsers_stats.asp">W3C schools Browser Stats</a> states 95% of users have JavaScript On. So unless you specifically want to cater for devices like Sony PSP (which has very poor JavaScript support) the dynamic publishing method is recommended.</p>
<p>The advantages of the dynamic publishing method are: It avoids click-to-activate mechanisms to activate active content in Internet Explorer 6/7 and Opera 9+.</p>
<h2>Using parameters:</h2>
<p>There aren&#8217;t a lot of examples of using parameters. Here&#8217;s an example for making movies transparent. This is often necessary to have DHTML elements appear ABOVE the flash movies (as well as content / imagery below.)</p>
<pre>
&lt;script type=&quot;text/javascript&quot;&gt;
// &lt;![CDATA[
	var flashvars = false;
    var params = {
		quality: &quot;high&quot;,
		wmode: &quot;transparent&quot;,
		scale: &quot;noscale&quot;
	};
	var attributes = {};
	swfobject.embedSWF(&quot;/flash/movie.swf&quot;, &quot;flashcontentID&quot;,
&quot;550&quot;, &quot;400&quot;, &quot;6.0.0&quot;, &quot;false&quot;, flashvars,
params, attributes);
// ]]&gt;
&lt;/script&gt;
</pre>
<h2>Bugs:</h2>
<p>There appears to be an unresolved issue where the flash movie doesn&#8217;t load in Internet Explorer 7. You can find more details at the <a href="http://www.flashcomguru.com/index.cfm/2007/6/21/swfobject-problem-ie7">flashcomguru.com forum</a></p>
<p>Adobe state only a very small number of IE7 users are affected but many users believe the issue is more widespread. </p>
<p>Setting the flash version to &quot;0&quot; does solve the issue. But if the user doesn&#8217;t have flash the alternative content is not served. <a href="http://www.adobe.com/products/player_census/flashplayer/">Adobe.com&#8217;s player census</a> state about 98% of users have flash player version 7 and above installed. (Only 80% use version 9 so this solution would not be satisfactory). </p>
<pre>
&lt;!--[if !IE 7]&gt;&lt;!--&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
    // &lt;![CDATA[
	swfobject.embedSWF(&quot;/flash/movie.swf&quot;, &quot;flashcontentID&quot;,
&quot;550&quot;, &quot;400&quot;, &quot;6.0.0&quot;, &quot;false&quot;, flashvars,
params, attributes);
    // ]]&gt;
    &lt;/script&gt;
&lt;!--&lt;![endif]--&gt;

&lt;!--[if IE 7]&gt;&lt;!--&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
    // &lt;![CDATA[
	swfobject.embedSWF(&quot;/flash/movie.swf&quot;, &quot;flashcontentID&quot;,
&quot;550&quot;, &quot;400&quot;, &quot;0&quot;, &quot;false&quot;, flashvars,
params, attributes);
        // ]]&gt;
    &lt;/script&gt;
&lt;!--&lt;![endif]--&gt;
</pre>
<p>Alternatively, use the alternative content to embed the movie and then use a src=&#8221;image.gif&#8221; with details describing what&#8217;s happening / what steps to take.</p>
<p>Note: Not sure how using using expressinstall.swf affects this issue. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ekstasis.net/log/2009/01/28/using-swf-object-version-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Standards</title>
		<link>http://www.ekstasis.net/log/2008/03/26/standards/</link>
		<comments>http://www.ekstasis.net/log/2008/03/26/standards/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 22:09:49 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.ekstasis.net/log/2008/03/26/standards/</guid>
		<description><![CDATA[HTML Markup:

XHTML Strict 1.0 W3C valid markup.
Semantically correct markup &#8211; e.g. use &#60;ul&#62; unordered lists for any list of items.
Common identifiers should be used based on potential HTML classes and hCard microformat.

Cross Browser Valid:

Identical (and fully functional) user experience across browsers. (note: browser differences for font anti-aliasing are expected) &#8211; Internet Explorer 6, 7 &#038; [...]]]></description>
			<content:encoded><![CDATA[<p>HTML Markup:</p>
<ul>
<li>XHTML Strict 1.0 W3C valid markup.</li>
<li>Semantically correct markup &#8211; e.g. use &lt;ul&gt; unordered lists for any list of items.</li>
<li>Common identifiers should be used based on potential HTML classes and hCard microformat.</li>
</ul>
<p>Cross Browser Valid:</p>
<ul>
<li>Identical (and fully functional) user experience across browsers. (note: browser differences for font anti-aliasing are expected) &#8211; Internet Explorer 6, 7 &#038; 8 + Safari 2 &#038; 3 + Firefox 2 &#038; 3 + Google Chrome + Opera 9  for Windows XP | Firefox 2 &#038; 3 + Safari 2 &#038; 3 for Mac OSX.</li>
</ul>
<p>CSS Styling:</p>
<ul>
<li>CSS styles must be completely unobtrusive with no inline styles.</li>
<li>Elements should not be positioned absolutely unless necessary &#8211; All main element blocks should normally be positioned relatively so if new content is added the existing elements would automatically reposition in the flow. Also wherever font-size is increased the layout integrity remains.</li>
</ul>
<p><span id="more-86"></span><br />
Client side scripting:</p>
<ul>
<li>All JavaScript should be unobtrusive and loaded / called through external files &#8211; using IDs or Classes as hooks, no inline JavaScript such as onclick functions.</li>
<li>The existence of Functions and Objects should be tested for before use where practical.</li>
<li>The jQuery library is preferred.</li>
</ul>
<p>Accessibility:</p>
<ul>
<li>JavaScript features are unobtrusive and the dynamic features degrade well with scripting disabled: All content should be accessible with JavaScript disabled including hidden or asynchronously included content. (e.g. Content asynchronously included with AJAX is replaced with a standard link for screen readers or clients with no javaScript.)</li>
<li>Content should be accessible via keyboard for users without mouse control.</li>
<li>Using meaningful ALT text for information images.</li>
<li>Links should have descriptive hyperlink text and titles warning of link actions.</li>
<li>Text colours have adequate contrast for colour blind/challenged users.</li>
<li>Avoid the use of frames, which are difficult for special browsers to interpret.</li>
<li>Keyboard shortcut to main content available.</li>
<li>Labels assigned to form items and forms have accessible design.</li>
</ul>
<p>Usability:</p>
<ul>
<li>Links, buttons &#038; other dynamic elements have hover states, focus states and active states.</li>
<li>AJAX calls include history recording for forward / back buttons and bookmarking / links.</li>
<li>Navigation menu will only activate when the user intends to use it – i.e. user slows the cursor down over a link. The menu is not activated if the cursor is dragged across the menu. (through a delay or hover intent script)</li>
<li>Search field has suggestion. This  is greyed out until the user starts typing.</li>
</ul>
<p>SEO:</p>
<ul>
<li>Site is fully available without JavaScript.</li>
<li>Semantic mark-up with consistent URL, breadcrumb and content titles. Where titles are graphical, &lt;h1&gt; image replacement techniques are used.</li>
<li>CSS coding allows the content to appear before the top and left navigation in the source code. Spiders will arrive at the header then the &lt;h1&gt; tags at the top of the content. They spider the content first then the navigation and footer last &#8211; enhancing SEO.</li>
</ul>
<p>Optimization:</p>
<ul>
<li>Repeating background image layers used for reoccurring design patterns.</li>
<li>Dynamic graphical elements preloaded and highlighted using CSS sprites technique.</li>
<li>AJAX used to pull in optional content where file size may degrade performance.</li>
</ul>
<p>Accessibility issues that are not priority 1 issues and do not fail the legal Accessibility guideline requirements:<br />
- Text input fields with a default value &#8211; Text fields may have a default value &#8211; but only for users with JavaScript enabled (96% of users). This is so that a &#8216;dynamic&#8217; default value can be added that disappears when the user click in the box. This is a superior solution but not 100% accessible to people with disabilities.<br />
- Adjacent links are separated by white space &#8211; CSS is used to separate some adjacent links. This can make it difficult for some older assistive technologies (readers for the blind). This is done to improve performance and ease of future updates. People should update their older assistive technologies.<br />
- Web colour scheme may not be tested against protanope, deuteranope, and tritanope colour-blindness.<br />
- Form fieldsets do not have legends. These are normally catered for by titles, or left out when the design requires.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ekstasis.net/log/2008/03/26/standards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Good Web Development Books</title>
		<link>http://www.ekstasis.net/log/2007/12/15/latest-books/</link>
		<comments>http://www.ekstasis.net/log/2007/12/15/latest-books/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 10:52:59 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.ekstasis.net/log/2007/12/15/latest-books/</guid>
		<description><![CDATA[Good web dev reference books:




]]></description>
			<content:encoded><![CDATA[<p>Good web dev reference books:</p>
<p><a class="books" href="http://www.amazon.co.uk/gp/product/0980285801?ie=UTF8&#038;tag=httpwwwekstas-21&#038;linkCode=as2&#038;camp=1634&#038;creative=6738&#038;creativeASIN=0980285801"><img  class="reflect rheight10 ropacity30" src="/images/blog/affilliate/simply-javascript.jpg"></a><img class="amazonLinkBlock" src="http://www.assoc-amazon.co.uk/e/ir?t=httpwwwekstas-21&#038;l=as2&#038;o=2&#038;a=0980285801" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p>
<p><a class="books" href="http://www.amazon.co.uk/gp/product/1590597311?ie=UTF8&#038;tag=httpwwwekstas-21&#038;linkCode=as2&#038;camp=1634&#038;creative=6738&#038;creativeASIN=1590597311"><img class="reflect rheight10 ropacity30"  src="/images/blog/affilliate/php-solutions.jpg"></a><img class="amazonLinkBlock" src="http://www.assoc-amazon.co.uk/e/ir?t=httpwwwekstas-21&#038;l=as2&#038;o=2&#038;a=1590597311" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p>
<p><a class="books" href="http://www.amazon.co.uk/gp/product/1590598563?ie=UTF8&#038;tag=httpwwwekstas-21&#038;linkCode=as2&#038;camp=1634&#038;creative=6738&#038;creativeASIN=1590598563"><img class="reflect rheight10 ropacity30"  src="/images/blog/affilliate/dom-scripting.jpg"></a><img class="amazonLinkBlock" src="http://www.assoc-amazon.co.uk/e/ir?t=httpwwwekstas-21&#038;l=as2&#038;o=2&#038;a=1590598563" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p>
<hr class="clear" />
]]></content:encoded>
			<wfw:commentRss>http://www.ekstasis.net/log/2007/12/15/latest-books/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DHTML tree menu testing</title>
		<link>http://www.ekstasis.net/log/2006/12/19/dhtml-tree-menu-testing/</link>
		<comments>http://www.ekstasis.net/log/2006/12/19/dhtml-tree-menu-testing/#comments</comments>
		<pubDate>Tue, 19 Dec 2006 20:49:02 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.ekstasis.net/log/2006/12/19/dhtml-tree-menu-testing/</guid>
		<description><![CDATA[
Testing and evaluating DHTML menu trees.
Each menu included in the list (below) has it&#8217;s own testing area. They&#8217;ve been tested for full functionality within a working &#8216;mini site&#8217; and adapted to demonstrate whether it&#8217;s possible to open nested levels and display the current location without altering the body tag.
Here&#8217;s the list of menus with a [...]]]></description>
			<content:encoded><![CDATA[<div align="center"><img alt="menu tree" title="menu tree" class="reflect rheight20 ropacity40" src="/images/logpics/menutree.jpg" /></div>
<h4>Testing and evaluating DHTML menu trees.</h4>
<p>Each menu included in the list (below) has it&#8217;s own testing area. They&#8217;ve been tested for full functionality within a working &#8216;mini site&#8217; and adapted to demonstrate whether it&#8217;s possible to open nested levels and display the current location without altering the body tag.</p>
<p>Here&#8217;s the list of menus with a link to the test and a link to the original sites:</p>
<table width="100%" cellpadding="0" border="0">
<tr>
<td><strong>Link to test area</strong></td>
<td><strong>Link to original site</strong></td>
</tr>
<tr>
<td><a href="/tests/menu08/">ECMA menu test</a><a href="/tests/menu12/" /></td>
<td><a href="http://juicystudio.com/article/ecmascriptmenu.php">Juicystudio.com menu</a></td>
</tr>
<tr>
<td><a href="/tests/menu08/">Ecommnet menu test</a></td>
<td><a href="http://www.ecommnet.co.uk/test/juicymenu/testthis4.asp">Ecommnet.co.uk menu</a></td>
</tr>
<tr>
<td><a href="/tests/menu12/">PDE menu test</a></td>
<td><a href="http://onlinetools.org/tools/dom-tree-menu-puredom/">Onlinetools.org menu</a></td>
</tr>
<tr>
<td><a href="/tests/menu09/">Splintered menu test</a></td>
<td><a href="http://www.splintered.co.uk/experiments/archives/menu_replace/">Splintered.co.uk menu</a></td>
</tr>
<tr>
<td><a href="/tests/menu03/">DNolan menu test</a></td>
<td><a href="http://www.dnolan.com/code/js/listmenu/">DNolan.com menu</a></td>
</tr>
<tr>
<td><a href="/tests/menu13/">MKTree menu test</a></td>
<td><a href="http://www.mattkruse.com/javascript/mktree/">Mattkruse.com MKTree menu</a></td>
</tr>
<tr>
<td><a href="/tests/menu10/">Simple Tree menu test</a></td>
<td><a href="http://www.dynamicdrive.com/dynamicindex1/navigate1.htm">Dynamicdrive.com menu</a></td>
</tr>
<tr>
<td><a href="/tests/menu05/">Click drop menu test</a></td>
<td><a href="http://bonrouge.com/br.php?page=clickdrop">Bonrouge.com Clickdrop menu</a></td>
</tr>
<tr>
<td><a href="/tests/menu01/">CreateMenu menu test</a></td>
<td><a href="http://www.codingforums.com/showthread.php?t=42084&#038;page=5">Codingforums.com Mike&#8217;s tree</a></td>
</tr>
<tr>
<td><a href="/tests/menu11/">Gazingus menu test</a></td>
<td>Site no longer available</td>
</tr>
</table>
<p>
<span id="more-32"></span></p>
<p>Displaying the &#8216;current location&#8217; is vital for clear site navigation. This feature is not usually included with the original menu source code. In order to test whether it is possible to adapt the menus to include this feature each menu has been set up &#8211; where possible &#8211; to indicate the &#8216;current location&#8217; and automatically open the tree at that level.</p>
<p>Links below include the local test area and the original URL providing the source code.</p>
<p>Only free-of-charge menu systems are included in this evaluation.</p>
<p>Overview of evaluation criteria:</p>
<ul>
<li>Is it accessible? Driveable by keyboard only?</li>
<li>How separate is the content, presentation, and behaviour.</li>
<li>Does it degrade well without JavaScript or CSS?</li>
<li>How easy is it to indicate the &#8216;current location&#8217; of the page selected?</li>
<li>Does it opens and displays current status for an included page &#8211; [e.g. HTML: main.php?page=page1.] i.e. cannot use body tags or code in  section of page?</li>
<li>When clicking on the parent item / title of the section do the nested list items open &#8211; i.e. not just clicking on the graphic which can cause confusion?</li>
<li>Is it xhtml 1.0 strict valid?</li>
</ul>
<p>In order to keep the nested levels visible at a specific location I have used one of two types of server-side functions:</p>
<pre><code><</code>?php
$theuri = $_SERVER['REQUEST_URI']; ?>
<code><</code>?php
if ( ($theuri =="/s01sub1a01.php") or ($theuri ==
"/tests/menu13/section1pages/s01sub1a02.php"))
echo " class=\"liOpen\"";
else echo " class=\"liClosed\""; ?>
</pre>
<p>or</p>
<pre><code><</code><code>?php
if ( ($thisPage=="s01sub1b01")
or ($thisPage=="s01sub1b02") or ($thisPage=="s01sub1b03") )
echo " rel=\"open\""; ?></code></pre>
<p>A better method to use is demonstrated below.<br />
This has not been used in these tests because of the need for<br />
modRewrite using the RewriteEngine:</p>
<pre><code>$lines = split("\n", $menu);
foreach ($lines as $line) {
$current = false;
preg_match('/href="([^" mce_href="([^"]+)"/', $line, $url);
if (substr($_SERVER["REQUEST_URI"], 0, 5) == substr($url[1], 0, 5)) {
$line = str_replace('</code><code><</code>a h', '<code><</code>
<code>a id="current" h', $line); }
echo $line."\n";
}
</code>
</pre>
<p>[Full source code available at: <a title="pregmatch code" href="http://photomatt.net/scripts/intellimenu">http://photomatt.net/</a> ]</p>
<p></p>
<p>or</p>
<pre><code><</code><code>?php
$menu =
file_get_contents("/inc/menu.htm");
$menu = preg_replace("|</code><code><</code>li><code><</code>
<code>a xhref=\"" .
basename($_SERVER['PHP_SELF']) . "\">(.*),/code><code><</code><code>!--[^-->]+></code>
<code><</code><code>/li>|U","</code><code><</code>
<code>li class=\"current\">$1</code><code><</code><code>/li>", $menu);
echo $menu;</code>
<code>?></code></pre>
<p>[Full source code currently lost and code not tested. ]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ekstasis.net/log/2006/12/19/dhtml-tree-menu-testing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DOM drag-sort lists</title>
		<link>http://www.ekstasis.net/log/2006/04/05/dom-drag-sort-lists/</link>
		<comments>http://www.ekstasis.net/log/2006/04/05/dom-drag-sort-lists/#comments</comments>
		<pubDate>Thu, 06 Apr 2006 00:20:48 +0000</pubDate>
		<dc:creator>mat</dc:creator>
				<category><![CDATA[DOM]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.ekstasis.net/log/?p=9</guid>
		<description><![CDATA[DOM-Drag is a dragging API for modern DHTML browsers. It allows users to move elements of a page. The movement can be unrestricted, or constrained to a area, such as an ordered list. The same functionality has also been developed using PHP. It&#8217;s a great way to add some dynamics to otherwise static HTML/CSS layouts.
There&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>DOM-Drag is a dragging API for modern DHTML browsers. It allows users to move elements of a page. The movement can be unrestricted, or constrained to a area, such as an ordered list. The same functionality has also been developed using PHP. It&#8217;s a great way to add some dynamics to otherwise static HTML/CSS layouts.</p>
<p>There&#8217;s a fantastic application from Tim at <a href="http://tool-man.org/examples/">ToolMan.org</a>. It lets visitors rearrange the position of an item in a list, and if the elements contain text they can a edit the titles as they see fit. It could be a navigation menu or a bunch of MP3s.</p>
<p>I&#8217;ve created an adjustable site link list you can play with in this site &#8211; it&#8217;s here: <a href="/resources/domlist.php">drag-sort site link list</a>. It has the cookie script working so the items stay in place when you return to the site.</p>
<p>The examples on the Toolman site for sorting and edit in place don&#8217;t store the order in a cookie. After advice from The (very kind) Tool Man, I got cookies working on the &#8217;sorting in two dimensions&#8217; by adding a unique ID to each list item. The cookie script is from <a href="http://www.quirksmode.org/">Quirksmode.org</a>. Cookies are a necessity, as most applications are only useful if a user can keep the chosen order when returning to the page.</p>
<p>There are a number of alternative approaches to drop-drag lists. <a href="http://www.youngpup.net/2001/domdrag">Youngpup</a> has a site with useful tutorials and examples. He also uses DOM JavaScript. <a href="http://neb.net/playground/dragdrop/">Neb.net </a>is an example of dragging between two lists using PHP. The first application that comes to mind is allowing visitors to move their preferred links from a main menu to a &#8216;quick links&#8217; or &#8216;favourites&#8217; menu. <a href="http://demo.script.aculo.us/shop">Scriptaculous drag-drop cart</a> has a drag-drop shopping cart. Looks great and really easy to use. <a href="http://cyberdummy.co.uk/test/cart.php">Cyberdummy drag-drop cart</a> has created a version using PHP. Cyberdummy  also demonstrates a <a href="http://cyberdummy.co.uk/test/dd.php">PHP drag-drop</a> version where you can save the order using a database.</p>
<p>There&#8217;s number of useful DOM-drag-drop-DHTML links listed in the <a href="/site/dhs/dom_drag">DOM-drag JavaScript scripts</a> section.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ekstasis.net/log/2006/04/05/dom-drag-sort-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
