<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>To reach the zenith of programming</title>
	<atom:link href="http://knavet.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://knavet.wordpress.com</link>
	<description>Still a long way to go...</description>
	<lastBuildDate>Sun, 18 Nov 2007 06:31:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='knavet.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>To reach the zenith of programming</title>
		<link>http://knavet.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://knavet.wordpress.com/osd.xml" title="To reach the zenith of programming" />
	<atom:link rel='hub' href='http://knavet.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Creating an extensible AJAX web site in a few minutes (Part 1).</title>
		<link>http://knavet.wordpress.com/2007/11/18/creating-an-extensible-ajax-web-site-in-a-few-minutes-part-1/</link>
		<comments>http://knavet.wordpress.com/2007/11/18/creating-an-extensible-ajax-web-site-in-a-few-minutes-part-1/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 20:11:22 +0000</pubDate>
		<dc:creator>Knave</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://knavet.wordpress.com/2007/11/18/creating-an-extensible-ajax-web-site-in-a-few-minutes-part-1/</guid>
		<description><![CDATA[Preface:I do realize that there are probably tons of tutorial guides out there describing what AJAX is, how it works and the rest. This post will introduce a few different techniques and technologies together to create a better site. Tools of the Trade To get yourself started, you need the tools to make yourself more [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knavet.wordpress.com&amp;blog=1615548&amp;post=11&amp;subd=knavet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="background-color:#dddddd;padding:6px;"><strong><em>Preface:</em></strong><br />I do realize that there are probably tons of tutorial guides out there describing what AJAX is, how it works and the rest. This post will introduce a few different techniques and technologies together to create a better site.</p>
<h4></h4>
<h4>Tools of the Trade</h4>
<p>To get yourself started, you need the tools to make yourself more <em><u>productive</u></em>.</p>
<ul>
<li><a href="http://www.eclipse.org" target="_blank">Eclipse IDE</a> (a free open source IDE)
<ul>
<li><a href="http://labs.adobe.com/technologies/jseclipse/" target="_blank">JSEclipse Plugin</a> (a free plugin for the Eclipse IDE for editing JavaScript files) </li>
</ul>
<li><a href="http://www.mozilla.com/en-US/firefox/" target="_blank">Mozilla FireFox browser</a> (do you consider yourself a web developer without even this?)
<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1843" target="_blank">FireBug plugin</a> (plugin for FireFox. The ULTIMATE AJAX development tool available) </li>
</ul>
<li><a href="http://notepad-plus.sourceforge.net/uk/site.htm" target="_blank">NotePad++ editor</a> (save yourself from the misery that is the NotePad that comes with Windows. Or if you have a better editor like VS2005/2008 for HTML editing, use it.) </li>
</ul>
<h4>Making use of existing frameworks</h4>
<p>Why waste precious time reinventing the wheel when its available and free? We will be making use of the following libraries as we go along.</p>
<ul>
<li><a href="http://developer.yahoo.com/yui/grids/" target="_blank">Yahoo UI Grid layout style</a> (nice style sheet template that provides well-tested CSS layouts)
<li><a href="http://jquery.com/" target="_blank">jQuery JavaScript Library</a> (a very popular JavaScript library)
<ul>
<li><a href="http://docs.jquery.com/UI/Tabs" target="_blank">jQuery Tabs plugin</a> (for creation of Tabs)
<li>JQuery Flora theme (part of download package for jQuery) </li>
</ul>
<li><a href="http://openjsan.org/" target="_blank">JSAN JavaScript Script Loader</a> (for dynamic loading of JS files) </li>
</ul>
<h4>Creating the Structure</h4>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;!</span><span style="color:#800000;">DOCTYPE</span> <span style="color:#ff0000;">html</span> <span style="color:#ff0000;">PUBLIC</span> <span style="color:#0000ff;">"-//W3C//DTD XHTML 1.0 Transitional//EN"</span> <span style="color:#0000ff;">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">html</span> <span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">="http://www.w3.org/1999/xhtml"</span><span style="color:#0000ff;">&gt;</span>
    <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">head</span><span style="color:#0000ff;">&gt;</span>
        <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">title</span><span style="color:#0000ff;">&gt;</span>Demo Ajax<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">title</span><span style="color:#0000ff;">&gt;</span>
    <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">head</span><span style="color:#0000ff;">&gt;</span>
    <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">body</span><span style="color:#0000ff;">&gt;</span>
        My Page
    <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">body</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">html</span><span style="color:#0000ff;">&gt;</span>
        </pre>
</div>
<p>Now this looks extremely empty. Let&#8217;s make use of our Yahoo UI style as well as our custom style design.</p>
<ol>
<li>Create your custom style sheet, e.g. <strong>site.css</strong>.
<li>Add a reference to the Yahoo UI style sheet and overwrite/modify any styles you wish to implement. </li>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">@import "reset-fonts-grids<span style="color:#006080;">-min.css";</span>
#hd { <span style="color:#0000ff;">background-color</span>:<span style="color:#006080;">#cccccc;</span> <span style="color:#0000ff;">font-size</span>:<span style="color:#006080;">182%;</span> <span style="color:#0000ff;">padding</span>: <span style="color:#006080;">4px;</span> }
#bd { <span style="color:#0000ff;">padding</span>: <span style="color:#006080;">20px 10px;</span>}
#ContentLayer { <span style="color:#0000ff;">border</span>:<span style="color:#006080;">1px solid #999;</span> <span style="color:#0000ff;">padding</span>: <span style="color:#006080;">6px;</span>}
#ft { <span style="color:#0000ff;">font-size</span>:<span style="color:#006080;">85%;</span> }</pre>
</div>
<li>Change your html to include the style sheet as well as Yahoo UI&#8217;s grid layout template. </li>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;!</span><span style="color:#800000;">DOCTYPE</span> <span style="color:#ff0000;">html</span> <span style="color:#ff0000;">PUBLIC</span> <span style="color:#0000ff;">"-//W3C//DTD XHTML 1.0 Transitional//EN"</span> <span style="color:#0000ff;">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;</span><span style="color:#800000;">html</span> <span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">="http://www.w3.org/1999/xhtml"</span><span style="color:#0000ff;">&gt;</span>
    <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">head</span><span style="color:#0000ff;">&gt;</span>
        <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">title</span><span style="color:#0000ff;">&gt;</span>Demo Ajax<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">title</span><span style="color:#0000ff;">&gt;</span>
        <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">link</span> <span style="color:#ff0000;">rel</span><span style="color:#0000ff;">="stylesheet"</span> <span style="color:#ff0000;">type</span><span style="color:#0000ff;">="text/css"</span> <span style="color:#ff0000;">href</span><span style="color:#0000ff;">="site.css"</span> <span style="color:#0000ff;">/&gt;</span>
    <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">head</span><span style="color:#0000ff;">&gt;</span>
    <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">body</span><span style="color:#0000ff;">&gt;</span>
        <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">div</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">="doc3"</span> <span style="color:#ff0000;">class</span><span style="color:#0000ff;">="yui-t2"</span><span style="color:#0000ff;">&gt;</span>
            <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">div</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">="hd"</span><span style="color:#0000ff;">&gt;</span>
                My Demo Site!
            <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span>
            <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">div</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">="bd"</span><span style="color:#0000ff;">&gt;</span>
                <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">div</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">="yui-main"</span><span style="color:#0000ff;">&gt;</span>
                    <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">div</span> <span style="color:#ff0000;">class</span><span style="color:#0000ff;">="yui-b"</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">="ContentLayer"</span><span style="color:#0000ff;">&gt;</span>
                        Welcome to my site.
                    <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span>
                <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span>
                <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">div</span> <span style="color:#ff0000;">class</span><span style="color:#0000ff;">="yui-b"</span><span style="color:#0000ff;">&gt;</span>
                    <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">b</span><span style="color:#0000ff;">&gt;</span>Site Menu<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">b</span><span style="color:#0000ff;">&gt;</span>
                    <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ul</span><span style="color:#0000ff;">&gt;</span>
                        <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">li</span><span style="color:#0000ff;">&gt;&lt;</span><span style="color:#800000;">a</span> <span style="color:#ff0000;">href</span><span style="color:#0000ff;">="#"</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">="home"</span><span style="color:#0000ff;">&gt;</span>Home<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">a</span><span style="color:#0000ff;">&gt;&lt;</span><span style="color:#800000;">li</span><span style="color:#0000ff;">&gt;</span>
                        <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">li</span><span style="color:#0000ff;">&gt;&lt;</span><span style="color:#800000;">a</span> <span style="color:#ff0000;">href</span><span style="color:#0000ff;">="#"</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">="about"</span><span style="color:#0000ff;">&gt;</span>About<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">a</span><span style="color:#0000ff;">&gt;&lt;</span><span style="color:#800000;">li</span><span style="color:#0000ff;">&gt;</span>
                    <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">ul</span><span style="color:#0000ff;">&gt;</span>
                <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span>
            <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span>
            <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">div</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">="ft"</span><span style="color:#0000ff;">&gt;</span>
                Copyright <span style="color:#ff0000;">&amp;copy;</span> 2007
            <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span>
        <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span>
    <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">body</span><span style="color:#0000ff;">&gt;</span>
<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">html</span><span style="color:#0000ff;">&gt;</span>        </pre>
</div>
<li>Preview your html in your browser.<br /><a href="http://knavet.files.wordpress.com/2007/11/demo-1.gif"><img style="border-width:0;" height="122" alt="demo_1" src="http://knavet.files.wordpress.com/2007/11/demo-1-thumb.gif?w=244&#038;h=122" width="244" border="0"></a> </li>
</ol>
<h4>Inserting our Scripts</h4>
<p>Insert the reference to the jQuery.min.js, ui.tabs.min.js and create a new custom <strong>mysite.js</strong> to the html.</p>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">script</span> <span style="color:#ff0000;">type</span><span style="color:#0000ff;">="text/javascript"</span> <span style="color:#ff0000;">src</span><span style="color:#0000ff;">="scripts/jquery-1.2.1.min.js"</span><span style="color:#0000ff;">&gt;&lt;/</span><span style="color:#800000;">script</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">script</span> <span style="color:#ff0000;">type</span><span style="color:#0000ff;">="text/javascript"</span> <span style="color:#ff0000;">src</span><span style="color:#0000ff;">="scripts/ui.tabs.min.js"</span><span style="color:#0000ff;">&gt;&lt;/</span><span style="color:#800000;">script</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">script</span> <span style="color:#ff0000;">type</span><span style="color:#0000ff;">="text/javascript"</span> <span style="color:#ff0000;">src</span><span style="color:#0000ff;">="scripts/mysite.js"</span><span style="color:#0000ff;">&gt;&lt;/</span><span style="color:#800000;">script</span><span style="color:#0000ff;">&gt;</span></pre>
<h4>Modifying our Script</h4>
<p>Open up <strong>mysite.js</strong> with Eclipse (remember to configure JSEclipse. You will need to manually add the JS files to an Eclipse project due to a bug/issue).</p>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#008000;">//mysite.js</span>
<span style="color:#008000;">//Window OnLoad...</span>
$(document).ready(
    <span style="color:#0000ff;">function</span>() {
        $(<span style="color:#006080;">"#ContentLayer"</span>).html(<span style="color:#006080;">"Here's a &lt;b&gt;Big&lt;/b&gt; welcome!"</span>);
    }
);</pre>
</div>
<p>Test it on your browser and see the main contents reflected. How jQuery actually works is beyond the scope of this post. However, just note that the<strong> .ready()</strong> command will allow you to specify multiple startup executions on a state <strong><u>before</u></strong> Windows.OnLoad.</p>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#008000;">//mysite.js</span>
<span style="color:#008000;">//Window OnLoad...</span>
$(document).ready(
    <span style="color:#0000ff;">function</span>() {
        <span style="color:#008000;">//$("#ContentLayer").html("Here's a &lt;b&gt;Big&lt;/b&gt; welcome!");</span>

        $(<span style="color:#006080;">"#home"</span>).click(<span style="color:#0000ff;">function</span>() {
            $.get(<span style="color:#006080;">"myhomepage.html"</span>,<span style="color:#0000ff;">null</span>,
                <span style="color:#0000ff;">function</span>( response ) {
                    $(<span style="color:#006080;">"#ContentLayer"</span>).html( response );
                }
            );
            <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">false</span>;
        });
    }
);</pre>
</div>
<p></p>
<p>Next, we proceed to insert an Event Handler to the #Home element for the OnClick event. The code will proceed to load the contents from myhomepage.html into the Div layer &#8220;ContentLayer&#8221; via the HTTP Get method.</p>
<p>You can easily replace the code to obtain html contents from a common implementations like PHP/ASP files, as well as ASPX/JSP.</p>
<p>If you need to send parameters, you can easily pass them in to the $.get() command.</p>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">$(<span style="color:#006080;">"#home"</span>).click(<span style="color:#0000ff;">function</span>() {
    $.get(<span style="color:#006080;">"myhomepage.html"</span>,<span style="color:#006080;">"myparam1=thank&amp;myparam2=you"</span>,
        <span style="color:#0000ff;">function</span>( response ) {
            $(<span style="color:#006080;">"#ContentLayer"</span>).html( response );
        }
    );
    <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">false</span>;
});</pre>
</div>
<p>Each &#8220;function()&#8221; call is actually an anonymous method, similar in concept to anonymous delegate in .NET. It acts as a CallBack trigger. (Callbacks are function pointers which the target function will execute upon completion/reaching a certain trigger point).</p>
<p><em>To be continued&#8230;</em></p>
<p class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;"><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fknavet.wordpress.com%2f2007%2f11%2f18%2fcreating-an-extensible-ajax-web-site-in-a-few-minutes-part-1%2f"><img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fknavet.wordpress.com%2f2007%2f11%2f18%2fcreating-an-extensible-ajax-web-site-in-a-few-minutes-part-1%2f" border="0"></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/knavet.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/knavet.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/knavet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/knavet.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/knavet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/knavet.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/knavet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/knavet.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/knavet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/knavet.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/knavet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/knavet.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/knavet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/knavet.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/knavet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/knavet.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knavet.wordpress.com&amp;blog=1615548&amp;post=11&amp;subd=knavet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://knavet.wordpress.com/2007/11/18/creating-an-extensible-ajax-web-site-in-a-few-minutes-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b718660aca079c7548c503936f663772?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Knave</media:title>
		</media:content>

		<media:content url="http://knavet.files.wordpress.com/2007/11/demo-1-thumb.gif" medium="image">
			<media:title type="html">demo_1</media:title>
		</media:content>

		<media:content url="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fknavet.wordpress.com%2f2007%2f11%2f18%2fcreating-an-extensible-ajax-web-site-in-a-few-minutes-part-1%2f" medium="image">
			<media:title type="html">kick it on DotNetKicks.com</media:title>
		</media:content>
	</item>
		<item>
		<title>Modifying Meizu M6 to display Chinese Lyrics</title>
		<link>http://knavet.wordpress.com/2007/09/02/modifying-meizu-m6-to-display-chinese-lyrics-2/</link>
		<comments>http://knavet.wordpress.com/2007/09/02/modifying-meizu-m6-to-display-chinese-lyrics-2/#comments</comments>
		<pubDate>Sun, 02 Sep 2007 11:25:47 +0000</pubDate>
		<dc:creator>Knave</dc:creator>
				<category><![CDATA[Hack & Crack]]></category>

		<guid isPermaLink="false">http://knavet.wordpress.com/2007/09/02/modifying-meizu-m6-to-display-chinese-lyrics-2/</guid>
		<description><![CDATA[It&#8217;s been almost a month since I bought my Meizu M6 mini-player (4gb) version, and has since become an indispensable tool in my daily commute to &#38; fro my work place. Once I learnt that this nifty device is capable of displaying LRC files (basically a text-file that contains a song&#8217;s lyrics that are marked [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knavet.wordpress.com&amp;blog=1615548&amp;post=6&amp;subd=knavet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been almost a month since I bought my <a href="http://en.meizu.com/" target="_blank">Meizu M6 mini-player</a> (4gb) version, and has since become an indispensable tool in my daily commute to &amp; fro my work place.</p>
<p>Once I learnt that this nifty device is capable of displaying LRC files (basically a text-file that contains a song&#8217;s lyrics that are marked by time periods for synchronization during playback), I was extremely excited by the possibilities it bring.</p>
<p>Immediately I set about to download some of my favorite Chinese songs&#8217; lyrics from <a href="http://mp3.baidu.com/" target="_blank">Baidu</a>. Unfortunately, due to encoding issues the player is unable to display Chinese lyrics while in English language mode.</p>
<p>After a bit more research, I discovered that there exists a <a href="http://www.meizume.com/showthread.php?t=1169" target="_blank">Resource Editor</a> for the M6. Launching the program requires .NET framework 2.0 and Chinese fonts installed on your machine. I downloaded a nice skin modification <a href="http://www.meizume.com/showthread.php?t=1189" target="_blank">Eros</a> and opened the resource.bin file provided in the mod package with the editor.</p>
<p><a href="http://knavet.files.wordpress.com/2007/09/meizueditorscreen.gif"><img src="http://knavet.files.wordpress.com/2007/09/meizueditorscreen-thumb.gif?w=457&#038;h=358" alt="meizueditorscreen" height="358" width="457" /></a></p>
<p>Displayed on the 3 columns are language specified texts for the player in the order of Simplified Chinese, Traditional Chinese and English.</p>
<p>Painstakingly, I typed/copied each value from the English column and overwrote the corresponding value in the first column (Simplified Chinese) and save the resource file.</p>
<p>To update the player,</p>
<ol>
<li>Copy the resource.bin file to the root folder.*</li>
<li>Plug out the USB connection (and wait for the library update to complete).</li>
<li>Shut down the player.</li>
<li>Re-start the player. It should display an update in progress message.</li>
<li>Once completed, go to your Settings-&gt;Language and select Simplified Chinese (1st option).</li>
<li>Try a lyric file from Baidu on your favourite Chinese song and enjoy the player even more!**</li>
</ol>
<p>*Even though the update did not clear the contents in my player, I did the necessary precaution by backing up my songs.</p>
<p>**To ensure the lyric file is shown, you must rename it&#8217;s file name to match exactly like the song&#8217;s file name. e.g. &#8220;Some Artist &#8211; song1.mp3&#8243; should be matched by &#8220;Some Artist &#8211; song1.lrc&#8221;.</p>
<p>***Album art can also be displayed during playback. Place an image (ideally less than 200&#215;200 pixels) in the same folder as the song and rename the image to the album&#8217;s name. Ensure the songs&#8217; album name (ID3 Tag) matches the image&#8217;s name. The player can only display either the album art or the song lyrics at any instance, with the lyrics display taking higher precedence.</p>
<p><font color="#0000ff"><em>My player is currently running version 2.003.2, and is an SP model (SP represents Samsung screen, which is the current production model. An older model TP uses Toshiba screens and has since been discontinued.).</em></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/knavet.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/knavet.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/knavet.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/knavet.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/knavet.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/knavet.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/knavet.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/knavet.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/knavet.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/knavet.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/knavet.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/knavet.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/knavet.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/knavet.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/knavet.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/knavet.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=knavet.wordpress.com&amp;blog=1615548&amp;post=6&amp;subd=knavet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://knavet.wordpress.com/2007/09/02/modifying-meizu-m6-to-display-chinese-lyrics-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b718660aca079c7548c503936f663772?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Knave</media:title>
		</media:content>

		<media:content url="http://knavet.files.wordpress.com/2007/09/meizueditorscreen-thumb.gif" medium="image">
			<media:title type="html">meizueditorscreen</media:title>
		</media:content>
	</item>
	</channel>
</rss>
