<?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>Carron Media &#187; Tips &amp; Tricks</title>
	<atom:link href="http://www.carronmedia.com/category/tips-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.carronmedia.com</link>
	<description>Web Design &#38; Development</description>
	<lastBuildDate>Wed, 15 Jun 2011 13:32:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Under used HTML tags</title>
		<link>http://www.carronmedia.com/under-used-html-tags/</link>
		<comments>http://www.carronmedia.com/under-used-html-tags/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 11:31:20 +0000</pubDate>
		<dc:creator>Ian Harris</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tags]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.carronmedia.com/?p=100</guid>
		<description><![CDATA[The current specification of HTML has been around for nearly 10 years now and us web developers all use this fundamental language on a daily basis. However, due to our busy schedules, there are a few HTML tags that tend to get either neglected or used in the wrong way.

I'm going to list a few of the more important tags here with some examples of their use. Hopefully this article will provide you with some guidance to why we should use them.]]></description>
			<content:encoded><![CDATA[<p>The current specification of HTML has been around for nearly 10 years now and us web developers all use this fundamental language on a daily basis. However, due to our busy schedules, there are a few HTML tags that tend to get either neglected or used in the wrong way.</p>
<p>I&#8217;m going to list a few of the more important tags here with some examples of their use. Hopefully this article will provide you with some guidance to why we should use them.</p>
<h4>1. &lt;address&gt;</h4>
<p>As the name suggests, the <code>&lt;address&gt;</code> tag is used to display contact details of the author of a web page. This means that you can standardised the format of either yours or your users contact details to make them easily identifiable.</p>
<p>The important thing to note is that the <code>&lt;address&gt;</code> tag is not limited to just a postal address, but you can include any contact details, such as a name, email, phone number, URL, etc.</p>
<p>For example:</p>
<pre class="brush: xml; title: ; notranslate">&lt;address&gt;
    Written by: Ian Harris&lt;br /&gt;
    Email: &lt;a href=&quot;mailto:info@example.com&quot;&gt;info@example.com&lt;/a&gt;&lt;br /&gt;
    Phone: 01234 567 890
&lt;/address&gt;
</pre>
<p>Although the <code>&lt;address&gt;</code>tag should be used where possible, that is a better alternative in the form of microformats. Take a look at the <a title="Microformats" href="http://microformats.org/wiki/hcard">hCard Microformats wiki page</a> for more information.</p>
<p><span id="more-100"></span></p>
<h4>2. &lt;abbr&gt; &amp; &lt;acronym&gt;</h4>
<p>The <code>&lt;abbr&gt;</code> and <code>&lt;acronym&gt;</code> are two very similar tags that are used to provide the user with additional information about an abbreviated phrase. The <code>&lt;abbr&gt;</code> tag is used to define terms such as CMS (Content Management System). The <code>&lt;acronym&gt;</code> tag defines an abbreviated term as if it can be spoken as a word, for example Radar (Radio Detection and Ranging). These tags are incredibly useful because when the user hovers their mouse over the abbreviated phrase, the full defined description is displayed as a tool tip.</p>
<p>Here is the code for these two examples:</p>
<pre class="brush: xml; title: ; notranslate">&lt;abbr title=&quot;Content Management System&quot;&gt;CMS&lt;/abbr&gt;</pre>
<pre class="brush: xml; title: ; notranslate">&lt;acronym title=&quot;Radio Detection and Ranging&quot;&gt;Radar&lt;/acronym&gt;</pre>
<p>Hover over the following to see them in action: <abbr title="Content Management System">CMS</abbr> and <acronym title="Radio Detection and Ranging">Radar</acronym></p>
<p>It is common practice to style these tags with a dotted bottom border so that users can identify that these tags have additional information attached to them:</p>
<pre class="brush: css; title: ; notranslate">abbr, acronym {
    cursor: help;
    border-bottom: 1px dotted #000;
}
</pre>
<p>Another good reason for using these tags is that they are used by screen readers and search engines to draw extra information from your content. This helps you to create accessible and search engine friendly content, which of course is what most of us are trying to achieve.</p>
<h4>3. &lt;cite&gt;</h4>
<p>The <code>&lt;cite&gt;</code> tag is used to indicate a citation and allows you to reference the source of information. This tag is probably most commonly used in conjunction with the <code>&lt;q&gt;</code> and <code>&lt;blockquote&gt;</code> tags as it allows you to specify the source of the quote.</p>
<p>As with the <code>&lt;abbr&gt;</code> and <code>&lt;acronym&gt;</code> tags, you can add the <code>title</code>attribute to display some extra information when the user hovers their mouse of it.</p>
<p>For example:</p>
<pre class="brush: xml; title: ; notranslate">&lt;p&gt;&lt;q&gt;O Romeo, Romeo, wherefore art thou Romeo?&lt;q&gt; - &lt;cite title=&quot;Romeo And Juliet Act 2, scene 2, 33–49&quot;&gt;William Shakespeare&lt;/cite&gt;&lt;/p&gt;
</pre>
<p><q>O Romeo, Romeo, wherefore art thou Romeo?</q> – <cite title="Romeo And Juliet Act 2, scene 2, 33–49">William Shakespeare</cite></p>
<p>It&#8217;s worth pointing out that the <code>&lt;q&gt;</code> tag has only just been supported by Internet Explorer in version 8.</p>
<h4>4. &lt;del&gt; &amp; &lt;ins&gt;</h4>
<p>The <code>&lt;del&gt;</code> and <code>&lt;ins&gt;</code> stand for deletion and insertion respectively. It&#8217;s quite common these days for an author to show the end user where content has been edited after it&#8217;s initial publication, especially when the content can be updated by more that one person. The <code>&lt;del&gt;</code>tag will add a strike-through to it&#8217;s contents, where as the <code>&lt;ins&gt;</code> will add an underline.</p>
<pre class="brush: xml; title: ; notranslate">&lt;p&gt;My favourite type of music is &lt;del&gt;rock&lt;/del&gt; &lt;ins&gt;reggae&lt;/ins&gt;.&lt;/p&gt;
</pre>
<p>This is displayed as: My favourite type of music is <del>rock</del> <ins>reggae</ins>.</p>
<h4>5. &lt;dl&gt;, &lt;dt&gt; &amp; &lt;dd&gt;</h4>
<p>You are no doubt aware of the <code>&lt;ul&gt;</code> and <code>&lt;ol&gt;</code> tags and their uses, but there is another list called a <em>definition list</em> which looks like <code>&lt;dl&gt;</code>. In the traditional sense, this type of list should be used if you create a list of definition terms with associated descriptions. However, <a title="W3C list specification" href="http://www.w3.org/TR/REC-html40/struct/lists.html">W3C list specification</a> seems to indicate that you can use the <code>&lt;dl&gt;</code> tag to list any terms where there is a direct relationship between them.</p>
<p>The <code>&lt;dl&gt;</code> tag has two child elements which are <code>&lt;dt&gt;</code> and <code>&lt;dd&gt;</code> which stand for <em>definition term</em> and <em>definition definition</em>. There can be multiple <code>&lt;dd&gt;</code> tags associated with each <code>&lt;dt&gt;</code>.</p>
<p>For example:</p>
<pre class="brush: xml; title: ; notranslate">&lt;dl&gt;
    &lt;dt&gt;HTML&lt;/dt&gt;
        &lt;dd&gt;Hypertext Markup Language&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
    &lt;dt&gt;The FA Cup Final&lt;/dt&gt;
        &lt;dd&gt;When: 30th May, 2009 3pm&lt;/dd&gt;
        &lt;dd&gt;Where: Wembley Stadium&lt;/dd&gt;
&lt;/dl&gt;
</pre>
<p>This is displayed as:</p>
<dl>
<dt>HTML</dt>
<dd>Hypertext Markup Language</dd>
</dl>
<dl>
<dt>The FA Cup Final</dt>
<dd>When: 30th May, 2009 3pm</dd>
<dd>Where: Wembley Stadium</dd>
</dl>
<h4>6. &lt;sub&gt; &amp; &lt;sup&gt;</h4>
<p>The final two tags in this list are <em>subscript</em>, <code>&lt;sub&gt;</code> and <em>superscript</em>, <code>&lt;sup&gt;</code>. The same results can be achieve using CSS, but whats the point when you can use these two built in HTML tags.</p>
<p>There usage can be seen in the following examples:</p>
<pre class="brush: xml; title: ; notranslate">&lt;p&gt;The chemical formula for water is H&lt;sub&gt;2&lt;/sub&gt;O.&lt;/p&gt;
</pre>
<p>The chemical formula for water is H<sub>2</sub>O.</p>
<pre class="brush: xml; title: ; notranslate">&lt;p&gt;Today is the 12&lt;sup&gt;th&lt;/sup&gt; April.&lt;/p&gt;
</pre>
<p>Today is the 12<sup>th</sup> April.</p>
<h4>Conclusion</h4>
<p>In reality, you may rarely use some of the tags listed above. However, you should definitely keep them in mind and make sure you use them correctly when the need arises. The key to writing semantic code is to use the correct HTML tags for the correct application.</p>
<p>Semantically written code will help you product search engine friendly and accessible content, which after all, is what we should all be doing.</p>
<h4>Resources</h4>
<ul>
<li><a title="Wikipedia article about HTML" href="http://en.wikipedia.org/wiki/HTML">Wikipedia article about HTML</a></li>
<li><a title="Microformats" href="http://microformats.org/wiki/hcard">hCard Microformats wiki</a></li>
<li><a title="W3C list specification" href="http://www.w3.org/TR/REC-html40/struct/lists.html">W3C list specification</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.carronmedia.com/under-used-html-tags/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>5 Simple but useful JavaScript snippits</title>
		<link>http://www.carronmedia.com/5-simple-but-useful-javascript-snippits/</link>
		<comments>http://www.carronmedia.com/5-simple-but-useful-javascript-snippits/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 23:55:56 +0000</pubDate>
		<dc:creator>Ian Harris</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.carronmedia.com/?p=82</guid>
		<description><![CDATA[JavaScript can be employed on your website to perform an whole multitude of simple, but quite effective, tasks that make your job as a web developer that little bit easier. Over time, we have compiled a library of these little JavaScript snippets and we have listed a few of our favourites here.]]></description>
			<content:encoded><![CDATA[<p>JavaScript can be employed on your website to perform an whole multitude of simple, but quite effective, tasks that make your job as a web developer that little bit easier. Over time, we have compiled a library of these little JavaScript snippets and we have listed a few of our favourites here.</p>
<h4>1. &lsquo;Previous Page&rsquo; link</h4>
<p>This snippet will take the user back to the previous page that they have viewed. Pretty much like the standard browser back button really:</p>
<pre class="brush: xml; title: ; notranslate">&lt;a href=&quot;javascript:history.back(1)&quot;&gt;Previous Page&lt;/a&gt;
</pre>
<p><span id="more-82"></span></p>
<h4>2. &lsquo;Print this page&rsquo; links</h4>
<p>I&#8217;ve read quite a few mixed opinions about adding a link that allows users to print the current page. Some developers think that their users will already know how to print the page using the browsers toolbar and don&#8217;t need us cluttering our pages with unnecessary links. Others believe that we should make it easy for the user and remind them that they can print this content if they so wish. I am with the latter, but whatever your opinion, here it how you add a print link:</p>
<pre class="brush: xml; title: ; notranslate">&lt;a href=&quot;#&quot; onclick=&quot;window.print();return false;&quot;&gt;Print&lt;/a&gt;
</pre>
<h4>3. Close the current browser window</h4>
<p>On occasions, you might need want to give the user the option to easily close the current browser window. For example, you have created a CMS that uses pop-up top display information. This snippit will close the current browser window (or tab):</p>
<pre class="brush: xml; title: ; notranslate">&lt;a href=&quot;javascript:window.close();&quot;&gt;Click to Close&lt;/a&gt;
</pre>
<h4>4. Confirm prompt</h4>
<p>If you are asking the user to perform a certain action, like deleting something, you can prompt them to confirm that they definitely want to go ahead. This snippit intercepts by prompting with a Yes/No box and a message of your choice. If the user selects Yes, it will carry on to the URL in the link. Selecting No will just cancel the action.</p>
<pre class="brush: xml; title: ; notranslate">&lt;a href=&quot;delete.php&quot; onclick=&quot;return confirm('Are you sure you want to delete this?')&quot;&gt;Delete&lt;/a&gt;
</pre>
<h4>5. Replace broken images</h4>
<p>Sometimes you may link to images that are hosted on other domains, such as photos in your Flickr account. As this is external, you cannot guarantee that this content will always be available and if the site hosting the image was to go offline, you would be left with that nasty red cross that gives the impression that you don&#8217;t look after your site. The snippet below will display a default image if the external image is unavailable (obviously, you should only link to images where you have permission to do so, nobody likes a bandwidth thief).</p>
<pre class="brush: xml; title: ; notranslate">&lt;img src=&quot;http://www.mydomain.com/image.jpg&quot;
onerror='this.src=&quot;/images/unavailable.png&quot;' /&gt;
</pre>
<p>I hope these are useful to you, they have certainly helped us. Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.carronmedia.com/5-simple-but-useful-javascript-snippits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UK Postal Counties List</title>
		<link>http://www.carronmedia.com/uk-postal-counties-list/</link>
		<comments>http://www.carronmedia.com/uk-postal-counties-list/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 01:01:15 +0000</pubDate>
		<dc:creator>Ian Harris</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[UK Counties]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.carronmedia.com/?p=88</guid>
		<description><![CDATA[On a recent project, we were required to create a drop down list to display the UK's counties as part of a web form collecting users addresses. We assumed that this would be a pretty standard task and that there would be an abundance of pre-configured lists available on the Internet for download. After about an hour of research, it became clear that it was not going to be that simple. All of the lists we unearthed were either incomplete or out of date and it seems that we were not the first developers to run into this trouble.]]></description>
			<content:encoded><![CDATA[<p>On a recent project, we were required to create a drop down list to display the UK&#8217;s counties as part of a web form collecting users addresses. We assumed that this would be a pretty standard task and that there would be an abundance of pre-configured lists available on the Internet for download. After about an hour of research, it became clear that it was not going to be that simple. All of the lists we unearthed were either incomplete or out of date and it seems that we were not the first developers to run into this trouble.</p>
<p>You can see how it is easy to get it wrong though, take a look at the <a href="http://en.wikipedia.org/wiki/List_of_counties_of_the_United_Kingdom" title="Wikipedia list of UK counties">Wikipedia list of UK counties</a>. The list of counties has changed quite considerably over time, especially in Wales.</p>
<p><span id="more-88"></span><br />
As we were only interested in postal addresses for the web form, we decided it would be quicker and easier to compile our own list using the postal county data in this Wikipedia article. So here is a zipped file containing the HTML list as well as a XML list we created of the current UK postal counties. We hope this helps you out in some way. It may be worth just keeping these lists on file somewhere, you never know when you may need them.</p>
<div class="downloadlink">
<p><a href="http://www.carronmedia.com/publicfiles/UKCounties.zip" title="UKCounties.zip Download">UKCounties.zip</a> <small>1.55kb</small></p>
</div>
<h4>Resources</h4>
<ul>
<li><a href="http://en.wikipedia.org/wiki/List_of_counties_of_the_United_Kingdom" title="Wikipedia list of UK counties">Wikipedia list of UK counties</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.carronmedia.com/uk-postal-counties-list/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

