<?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>The English Guy Web Design &#187; indexof</title>
	<atom:link href="http://www.theenglishguy.co.uk/tag/indexof/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.theenglishguy.co.uk</link>
	<description>Web Design, WordPress/Drupal blog design &#38; theming, SEO, css. xhtml, php, coldfusion, jquery and more...</description>
	<lastBuildDate>Sun, 22 Aug 2010 20:07:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Opera and indexOf</title>
		<link>http://www.theenglishguy.co.uk/2008/01/11/opera-and-indexof/</link>
		<comments>http://www.theenglishguy.co.uk/2008/01/11/opera-and-indexof/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 12:16:04 +0000</pubDate>
		<dc:creator>rich</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[xhtml]]></category>
		<category><![CDATA[indexof]]></category>
		<category><![CDATA[opera]]></category>

		<guid isPermaLink="false">http://www.theenglishguy.co.uk/2008/01/11/opera-and-indexof/</guid>
		<description><![CDATA[I have been working on some new ordering pages at work for GRS. This includes the engraved labels, engraved plaques [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on some new ordering pages at work for <a href="http://www.grssigns.co.uk/" rel="tag">GRS</a>. This includes the engraved labels, engraved plaques and so on, and today, the <a href="http://www.grssigns.co.uk/mailorder/labels.php" rel="tag">safety sign stickers</a>.</p>
<p>I had a great idea yesterday of linking articles from the company blog to individual stickers, so one article for <a href="http://www.grssigns.co.uk/mailorder/labels.php?type=w&#038;style=Electrical">Electrical Warning</a> stickers, one article for <a href="http://www.grssigns.co.uk/mailorder/labels.php?type=p&#038;style=Noswimming" rel="tag">No Swimming</a> and so on. Great idea isn&#8217;t it? Google should pick up on it and it will generate traffic for the company&#8217;s website.</p>
<p>Then I ran into a problem. Because of the way I was handling the sign symbols, I was using an array and happened to use indexOf to find where a word was in the array. Opera and IE(7) were going nowhere with it &#8211; FireFox was fine (surprise). Then I found an article at CommaDot, entitled <a href="http://commadot.com/opera-js-troubleshooting/" rel="tag">Opera JS Troubleshooting</a> which resolved the issue, apparently a bug with the way Opera handles indexOf (and incidentally, it fixed IE7&#8242;s issue with it too). Here it is:</p>
<blockquote><p>
// This is solely to support indexOf in Opera.  Not sure of a better way to do this<br />
if (!Array.prototype.indexOf) {<br />
&nbsp;&nbsp;Array.prototype.indexOf = function(val, fromIndex) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (typeof(fromIndex) != â€˜numberâ€™) fromIndex = 0;<br />
&nbsp;&nbsp;&nbsp;&nbsp;for (var index = fromIndex,len = this.length; index < len; index++)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (this[index] == val) return index;<br />
&nbsp;&nbsp;&nbsp;&nbsp;return -1;<br />
&nbsp;&nbsp;}<br />
}
</p></blockquote>
<p>Now it all works properly, as it should, setting the document&#8217;s title and the h1 title on the page to the correct symbol name.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.theenglishguy.co.uk/2008/01/11/opera-and-indexof/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
