<?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>lstierneyltd &#187; javascript</title>
	<atom:link href="http://lstierneyltd.com/blog/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://lstierneyltd.com/blog</link>
	<description>Yet another development blog</description>
	<lastBuildDate>Wed, 13 Jul 2011 12:55:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Hierarchical Javascript Filenames</title>
		<link>http://lstierneyltd.com/blog/development/hierarchical-javascript-filenames/</link>
		<comments>http://lstierneyltd.com/blog/development/hierarchical-javascript-filenames/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 15:43:19 +0000</pubDate>
		<dc:creator>lawrence</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[object oriented]]></category>

		<guid isPermaLink="false">http://lstierneyltd.com/blog/?p=27</guid>
		<description><![CDATA[I&#8217;ve been using a lot of JQuery over the last few months and have to admit to being very impressed with the core library and the vast array of third party addons for it out there. On thing I have noticed however, and this a personal fault, is that I seem to be ending up [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using a lot of JQuery over the last few months and have to admit to being very impressed with the core library and the vast array of third party addons for it out there.</p>
<p>On thing I have noticed however, and this a personal fault, is that I seem to be ending up with some very large Javascript files: files which contain so much diverse functionality that were you coding in Java or PHP or <em>(insert your flavour of the month language here)</em> you would NEVER store in the same file.<code><span id="more-27"></span></code></p>
<p>I know that the Javascript I&#8217;m writing needs to be more truly Object Oriented but thats a topic for another day! With Javascript (as with other languages) you can have multiple class definions via one physical file and this is the essence of the situation I have found myself in. I could go down a Java style route and produce a hierarchy of files and folders but I&#8217;ve seen a simpler approach for logically organising physical Javascript files which I like among some of the JQuery libraries. Namely: trying to use hierarchical patterns within Javascript filenames.</p>
<p>Example &#8211; a webform</p>
<pre>
Filestructure:
form.js (will contain a lot of init()'s)
form.validate.js
form.logic.js
form.ajax.js
etc etc

Implementation (simplified):

var form = {
    validation: null,
    logic: null,
    ajax: null,
    init: function() {
        validate.init();
        logic.init();
        ajax.init();
        form.initEventHandlers();
    }
};
</pre>
<p>Admittedly this is a simple example but even breaking up your large files into several smaller ones immediately gets you back to thinking in a more OO mode and suddenly from having a series of unmanagebly large files and complaining bitterly you are back to thinking about class hierachies, inheritance &#8211; all the good stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://lstierneyltd.com/blog/development/hierarchical-javascript-filenames/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get latitude, longitude of location using google maps</title>
		<link>http://lstierneyltd.com/blog/development/tips/get-latitude-longitude-of-location-using-google-maps/</link>
		<comments>http://lstierneyltd.com/blog/development/tips/get-latitude-longitude-of-location-using-google-maps/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 11:08:43 +0000</pubDate>
		<dc:creator>lawrence</dc:creator>
				<category><![CDATA[quick tips]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://lstierneyltd.com/blog/?p=15</guid>
		<description><![CDATA[1. Right click map and &#8220;center on location&#8221;. 2. Execute this JS in browser address bar: javascript:void(prompt('',gApplication.getMap().getCenter()));]]></description>
			<content:encoded><![CDATA[<p>1. Right click map and &#8220;center on location&#8221;.<br />
2. Execute this JS in browser address bar:</p>
<pre>
javascript:void(prompt('',gApplication.getMap().getCenter()));
</pre>
]]></content:encoded>
			<wfw:commentRss>http://lstierneyltd.com/blog/development/tips/get-latitude-longitude-of-location-using-google-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

