<?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>Jamie Thompson &#187; JavaScript</title>
	<atom:link href="http://jamiethompson.co.uk/tags/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamiethompson.co.uk</link>
	<description>Web Developer</description>
	<lastBuildDate>Tue, 08 May 2012 10:58:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Advice for Budding Web Developers</title>
		<link>http://jamiethompson.co.uk/web/2008/08/18/advice-for-budding-web-developers/</link>
		<comments>http://jamiethompson.co.uk/web/2008/08/18/advice-for-budding-web-developers/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 17:00:38 +0000</pubDate>
		<dc:creator>Jamie Thompson</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[advice]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://jamazon.co.uk/?p=106</guid>
		<description><![CDATA[
The following guide came about after I was tasked with transferring my Web Development expertise into two VB developer colleagues. No mean feat in the one month I have left at my current place of work. Ultimately it&#8217;s possibly a futile task, but it&#8217;s worth a shot.
Web Development is not just collection of related technologies. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://s322999261.websitehome.co.uk/wp-content/uploads/2008/08/webdeveloper.jpg" alt="Jamie Thompson - Web Developer" title="webdeveloper" width="530" height="190" /></p>
<p>The following guide came about after I was tasked with transferring my Web Development expertise into two VB developer colleagues. No mean feat in the one month I have left at my current place of work. Ultimately it&#8217;s possibly a futile task, but it&#8217;s worth a shot.</p>
<p>Web Development is not just collection of related technologies. It&#8217;s a state of mind, and in that respect it is very much like <a href="http://www.imdb.com/title/tt0416394/quotes#qt0089411">Yorkshire</a>.</p>
<p> What follows is aimed at existing developers (VB or otherwise) looking to move into Web Development. The advice I offer is that of best practice in the field of Web Development. The books suggested are generally those which I have read myself that or that come highly recommended by friends and colleagues of mine.</p>
<h2>What is a Web Developer?</h2>
<blockquote><p>A web developer is a software developer or software engineer who is specifically engaged in the development of World Wide Web applications, or distributed network applications that are run over the HTTP protocol from a web server to a web browser. Many web developers are also skilled in related areas such as web design, information architecture, usability engineering, web content management systems, web server administration, database administration, software engineering, project management, network security, and search engine optimization.</p>
<p>Developers often specialize in either front-end or back-end work. Frontend developers tend to focus on the client-side and typically work with technologies such as markup languages, ECMAscript and its variants (JavaScript, JScript, ActionScript), CSS, and the DOM. Backend developers usually focus on the interaction between server-side frameworks using Perl, Python, Ruby, PHP, JSP, or .NET and databases. Some back-end developers maintain databases directly on their web servers, while in other situations the backend developer calls data, managed by a database administrator, on an external system.</p>
<p><em>- Wikipedia</em></p></blockquote>
<p>In my experience the statement about specialization comes into play more within larger organisations. Small to medium enterprises tend to look for generic web developers with a grounding in one or maybe two server-side frameworks as well as an understanding of (X)HTML / CSS and JavaScript. Generally speaking, most web developers begin their careers within smaller organisations, and while it is not always the case, you will tend to find a large degree of overlap between front-end and back-end web developers for this very reason.</p>
<h2>The Right Tools for The Job</h2>
<p>There was a time when the in thing was to use a WYSIWYG editor to design and develop websites. Those days have gone (Microsoft please pay attention! Visual Web Developer 2008? OMGWTFDONOTWANT!!*). Dreamweaver, whilst it&#8217;s design view should be used for nothing more than ridicule, is a perfectly adequate syntax highlighting code editor for web development. It also has the benefit of it&#8217;s built in FTP client which is very handy. What you use to edit your code is entirely a personal preference. Something with syntax highlighting and brace matching will save you time by helping you to work faster. Some options include:</p>
<ul>
<li><a href="http://notepad-plus.sourceforge.net">Notepad++</a>  &#8211; Windows  &#8211; Open source syntax highlighting code editor, many plugins available including an FTP client (compatible with Wine.. sort of)</li>
<li><a href="http://www.aptana.com/studio">Aptana Studio</a>  &#8211; Windows/Mac/Linux  &#8211; Eclipse based editor with an invaluable PHP debugger plugin as well as working nicely with html/css/javascript right out the box</li>
<li><a href="http://en.wikipedia.org/wiki/Notepad">Notepad</a> &#8211; Windows &#8211; included with any copy of Microsoft Windows (There&#8217;s no reason that, at a push you can&#8217;t ply your trade with this trusty tool)</li>
<li><a href="http://www.adobe.com/products/dreamweaver/">Dreamweaver</a> &#8211; You should be familiar with it if nothing else. For some reason your employer might INSIST that you use it.</li>
</ul>
<p>Mozilla Firefox is an excellent developer&#8217;s browser, and with the following plugins installed is close to a perfect development environment.</p>
<ul>
<li><a href="http://chrispederick.com/work/web-developer/">Web Developer Plugin</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1843">Firebug</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/6683">Firecookie</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/271">ColorZilla</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/249">HTML Validator</a></li>
</ul>
<p>For testing in multiple versions of Internet Explorer in Windows, <a href="http://www.my-debugbar.com/wiki/IETester/HomePage">IETester</a> is an invaluable tool. <a href="http://www.tatanka.com.br/ies4linux/page/Main_Page">IEs4Linux</a> is handy for linux based development environments but there&#8217;s not substitute for running virtual machines with differing OS/Browser setups to cover all bases. It is also a good idea to invest in a Mac of some description for testing purposes.</p>
<p>* To avoid confusion, the budding Web Developer should attempt to learn <a href="http://en.wikipedia.org/wiki/Lolcat">lolcat</a></p>
<h2>First Things First</h2>
<p>Your first task is to forget everything you think you know about Web Development. Forget Dreamweaver (for now). Please forget Frontpage. Don&#8217;t even THINK about cranking up Visual Studio, it isn&#8217;t a web development tool despite what Microsoft might tell you. To be sucessful in web development whether you plan to move into front-end or back-end development or even if you just want to be a competent web designer you need to start from the ground up. That&#8217;s HTML and CSS.</p>
<p>Knowing (X)HTML inside out is not an option. You cannot skip this step. CSS guru status is possibly optional for those in a soley back-end role where presentation and layout are the consideration of a front-end developer. Even so, I would argue that there&#8217;s no excuse for not learning at least the basic principles of CSS.  Whether you&#8217;re a designer designing for the web, a front-end developer implementing the designs of others, or a back-end developer providing the business logic behind someone else&#8217;s front-end, you should always strive to fully understand the medium in which you&#8217;re working and the way in which your design patterns impact on others.</p>
<p>It is possible to grasp the fundamentals of designing for the web in XHTML and CSS in a fairly short space of time. I know this from experience after watching a colleague of mine, a talented graphic designer, learn web design from the ground up simply by reading and trial and error over the course of several months. Of course, it goes without saying that the intricacies of cross browser compatibility can take years to fully master, and in this respect there is no substitute for the wealth of experience gained over time fixing one mind numbing IE6 bug after another, over and over and over again, until your eyes start to bleed and what&#8217;s left of your brain trickles out of your nose. One year and a bit later <a href="http://ricknunn.com/blog/2008/08/14/advice-to-budding-web-designers-developers/">Rick</a> is still a talented graphic designer but one who makes my life all the more bearable by chopping up his own designs and turning them into perfectly semantic valid XHTML and CSS. All it takes is patience and a thirst for knowledge.</p>
<h2>The Fundamentals</h2>
<p>Broadly speaking a page on the World Wide Web consists of</p>
<ul>
<li><strong>Markup</strong> &#8211; HTML or XHMTL &#8211; The bare-bones of the page structure and it&#8217;s content</li>
<li><strong>Style </strong>- CSS &#8211; colors, fonts, layout etc</li>
<li><strong>Client-side logic</strong> &#8211; JavaScript &#8211; how the page deals with complex user interaction.</li>
</ul>
<h2>Marking it up</h2>
<p>The only possible starting point is to learn to write markup. Markup is what defines the structure of the pages which make up the web. A common misconception, and one that&#8217;s more commonly held by those already within the IT industry is that there are many different technologies for displaying pages on the web. Whether the url of your page ends in .html, .asp, .php or one of a multitude of other extensions, the page that you see is your web browsers interpretation of some (X)HTML markup (hopefully) in conjunction with some CSS. The important thing to remember is that no matter what technology is used on the server-side to generate a web page, the web page is self never amounts to anything more than some HTML and CSS. We&#8217;ll touch on JavaScript later on but for now we&#8217;ll pretend that it doesn&#8217;t exist. So I have to say sorry to all you .NET developers but I&#8217;m afraid that ASP.NET pages really aren&#8217;t some kind of magical in-browser .NET application. It&#8217;s an illusion created by Visual Studio, Some poorly auto-generated HTML forms and a heap of really bad old-school JavaScript.</p>
<p>The standards for (X)HTML markup are set out by the W3C (World Wide Web Consortium). As a Web Developer you should strive for as much as much of your (X)HTML to validate against the doctype you specify; and you should ALWAYS declare a doctype (or the sky catch fire). You should validate your markup regularly during development and before release. Having a HTML validator built into your browser (such as Firefox) saves a lot of time in this respect. One of the best resources for learning the fundamentals of HTML and CSS is <a href="http://www.htmldog.com">htmldog.com</a>, whether you&#8217;re a total n00b or you&#8217;re halfway proficient in the basics already they seem to have tutorials and reference to suit. <a href="http://www.w3schools.com">W3Schools</a> is also a very good (but ugly) source of quick reference for pretty much all web technologies including HTML, CSS, JavaScript and most major server-side languages.</p>
<p>If you&#8217;re planning on heading down the .NET route of Web Development (and there&#8217;s nothing wrong with that), it&#8217;s imperative that you fully understand the concepts of semantic, valid HTML, pure CSS layouts as well as good JavaScript practices before you even open Visual Studio. That way you&#8217;ll have a solid understanding of which features of ASP.NET to take advantage of and which you need to avoid like the plague.</p>
<p>It is one thing to understand HTML, it is quite another to write semantic HTML and express context and meaning through markup. I would suggest reading up on the subject of semantic markup before going any further as a solid understanding of these principles will make the transition into the dark world of CSS much less painful.</p>
<p><strong>Reference:</strong></p>
<p><a href="http://www.htmldog.com">www.htmldog.com</a> &#8211; HTML and CSS Tutorials<br />
<a href="http://www.W3Schools.com">www.W3Schools.com</a> &#8211; Web Technologies Reference Guides<br />
<a href="http://www.w3.org/Consortium">www.w3.org/Consortium</a> &#8211; About the W3C</p>
<p><strong>Books:</strong></p>
<p><a href="http://books.google.co.uk/books?id=wm0Yip3Zo78C">HTML Mastery</a></p>
<h2>Cascading Style Sheets</h2>
<p>Style on the web is achieved using Cascading Style Sheets. An in depth guide to CSS is beyond the scope of this article but if HTML is the cake then you can think of CSS as the icing. CSS allows you to take your plain, u-nstyled, semantic markup and skin it anyway you choose without affecting it&#8217;s content or structure. Every presentational element of a website design can be achieved using CSS and CSS should be your only method of styling markup.</p>
<p>CSS support across browsers is inconsistent. Different browsers will render valid CSS in wildly different ways to each other, and it is in dealing with these cross browser issues that the skill and experience of the front-end developer really comes into play. Be prepared for hours of nail-biting CSS debugging action. There is no substitute for learning from your mistakes. It takes time to smooth your way through the minefield of browser incompatibilities but resources like quirksmode.org are a godsend providing explanations of common CSS bugs, workarounds and accepted means of circumventing certain issues (Mostly Microsoft Internet Explorer ones).</p>
<p><strong>Reference:</strong></p>
<p><a href="http://www.quirksmode.org">www.quirksmode.org</a> &#8211; CSS Bugs and Hacks<br />
<a href="http://www.positioniseverything.net">www.positioniseverything.net </a>- More CSS Bugs and Hacks</p>
<p><strong>Books:</strong></p>
<p><a href="http://books.google.co.uk/books?id=Mp1KAAAACAAJ">CSS Mastery</a><br />
<a href="http://books.google.co.uk/books?id=xxOtAAAACAAJ">CSS The Definitive Guide</a></p>
<h2>Client-Side Logic</h2>
<p>It is almost impossible to develop a modern web application without employing at least a small amount of client-side code in the form of JavaScript. But what is JavaScript? JavaScript is not Java, and if you say it is I will hurt you. JavaScript is not like Java. It isn&#8217;t even a stripped down version of Java.</p>
<p>JavaScript is the name erroneously given to the implementation of the ECMAScript scripting language which is built into almost all modern web browsers.</p>
<p>JavaScript is what allows the developer to deal with complex user interaction. Broadly speaking, any kind of interaction between the user and the page which involves more than simply moving the user to another page is probably controlled by JavaScript.</p>
<p>Each web browser implementation of ECMAScript varies slightly and this can catch out even the most experienced JavaScript developer. Many open source projects have sought to level the playing field with comprehensive cross browser libraries which attempt to provide solid cross-browser APIs for common programming tasks. These libraries commonly referred to as as &#8216;frameworks&#8217; allow developers to focus on writing their application rather than on the multitude of cross-browser issues their application faces; and I cannot be more clear when i say that &#8220;You really really need to use a JavaScript framework of some description or you&#8217;ll go clinically insane&#8221;</p>
<h2>JavaScript Frameworks</h2>
<ul>
<li><a href="http://www.jquery.com">jQuery</a> &#8211; The Write Less, Do More JavaScript Library</li>
<li><a href="http://mootools.net/">MooTools</a> &#8211; a compact JavaScript Framework</li>
<li><a href="http://www.prototypejs.org/">Prototype</a> &#8211; Easy AJAX and DOM manipulation</li>
<li><a href="http://dojotoolkit.org/">Dojo</a>  &#8211; the JavaScript Toolkit</li>
</ul>
<p>Some of these JavaScript frameworks make it possible by means of plugins to work on client-side logic with very little in-depth understanding of JavaScript. jQuery for example has a simple enough basic usage that designers with little to no programming experience are often able to integrate fairly complex interface logic unaided via plugins. Should you wish to develop anything more complex than what is available as a plugin you will need to learn JavaScript. For this you will need books. JavaScript is often dismissed as a &#8216;toy&#8217; language or simply as a very basic scripting language but it is in fact a very powerful language in it&#8217;s own right and can take some effort to master.</p>
<p>One thing all these frameworks have in common is AJAX. AJAX is the acronym of Asynchronous JavaScript and XML. To an extent AJAX is little more than a marketing term, like &#8220;Web 2.0&#8243;. Generally speaking, AJAX is a term mostly misunderstood by the vast majority of people who use it. The term AJAX is commonly used to refer to any form of JavaScript based rich user interface (another acronym commonly banded about is RIA &#8211; Rich Internet Application). In essence AJAX is the name erroneously given to any means by which modern web applications communicate asynchronously with a web server to provide a rich user interface. This communication doesn&#8217;t have to be XML, in fact more often than not it isn&#8217;t XML. The underlying technologies behind an AJAX request are way beyond the scope of this article. The best way to learn more about AJAX is by choosing a JavaScript framework and using it.</p>
<p><strong>Reference:</strong></p>
<p><a href="http://en.wikipedia.org/wiki/ECMAScript#History">A concise history of ECMAScript</a><br />
<a href="http://www.w3schools.com/JS/">JavaScript Tutorials</a><br />
<a href="http://en.wikipedia.org/wiki/AJAX">en.wikipedia.org/wiki/AJAX</a> &#8211; Sums it up better than I ever could</p>
<p><strong>Books:</strong></p>
<p><a href="http://books.google.co.uk/books?id=d_EPxT-DyJ8C">Learning JavaScript</a></p>
<p><a href="http://books.google.co.uk/books?id=KUrT29GBK7cC">AJAX hacks</a> (never read but looks to be a great little primer)</p>
<h2>Server-Side Logic</h2>
<p>The Server-side is where your web applications get down to business. This is where you connect to databases, manipulate data and make decisions based on user input. You could say this is the &#8220;real programming&#8221;, but that would be to the detriment of all your hard work on the client-side.</p>
<p>A front-end developer need not learn a server-side language, though it is good practice to understand at least the basics of the server-side language of any project you&#8217;re working on. Back-end developers it goes without saying should be proficient in at least one server-side language as well as SQL and database design principles. There are as many choices of server-side framework as you care to choose but your best option is to pick one and learn it inside out. Popular frameworks include.</p>
<p><a href="http://www.php.net">PHP</a> &#8211; Arguably the most ubiquitous open source server-side language of all time &#8211; That doesn&#8217;t make it the best though<br />
<a href="http://www.rubyonrails.org/">Ruby on Rails</a> &#8211; Favoured by cool kids with slick hairdos<br />
<a href="http://java.sun.com/products/jsp/">JSP</a> &#8211; Favoured for &#8220;Enterprise Solutions&#8221; and by those with smart beards<br />
<a href="http://en.wikipedia.org/wiki/Active_Server_Pages">ASP</a> &#8211; Also known as Classic ASP &#8211; Most commonly VBScript or JScript &#8211; Although defunct as a language, many developers will find themselves supporting ASP web apps for many years to come. It&#8217;s a valuable skill to have<br />
<a href="http://www.asp.net/">ASP.NET</a> &#8211; ASP&#8217;s big brother &#8211; Most commonly VB.NET or C# &#8211; Very powerful yet most usually favoured by those who don&#8217;t know what they&#8217;re doing</p>
<h2>Databases</h2>
<p>As a back-end developer you will need to be proficient in SQL (structured query language) which is often but not always pronounced &#8220;sequel&#8221;. SQL is the language in which almost all Database systems accept queries. The basics of SQL are the same from system to system, but each database system has it&#8217;s own slightly varying syntax. Popular relational database systems include:</p>
<ul>
<li><a href="http://www.mysql.com/">MySQL</a> &#8211; Open Source &#8211; Most popularly partnered with PHP</li>
<li><a href="http://www.postgresql.org/">PostgreSQL</a> &#8211; Open Source &#8211; slightly less popular than MySQL</li>
<li><a href="http://www.microsoft.com/sqlserver/2008">Microsoft SQL Server</a> &#8211; Most commonly used with ASP(.NET)</li>
<li><a href="http://www.oracle.com">Oracle</a> &#8211; if you&#8217;ve got money to burn</li>
</ul>
<p><strong>Reference:</strong><br />
<a href="http://www.w3schools.com/sql">www.w3schools.com/sql</a> &#8211; Basic SQL tutorial</p>
<p><strong>Books:</strong><br />
<a href="http://books.google.co.uk/books?id=Y3uCOQppkUIC">SQL in a Nutshell</a></p>
<h2>Final Thoughts</h2>
<p>So hopefully this has given you some new directions to spin off in on your journey into web development. Hopefully it&#8217;ll help you avoid some time-consuming pitfalls, maybe it won&#8217;t, and maybe that&#8217;s half the fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamiethompson.co.uk/web/2008/08/18/advice-for-budding-web-developers/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>An IE7 Bug That Returns MSIE 6.0 User Agent String</title>
		<link>http://jamiethompson.co.uk/web/2008/07/23/an-ie7-bug-that-returns-msie-60-user-agent-string/</link>
		<comments>http://jamiethompson.co.uk/web/2008/07/23/an-ie7-bug-that-returns-msie-60-user-agent-string/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 13:44:15 +0000</pubDate>
		<dc:creator>Jamie Thompson</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://jamazon.co.uk/?p=99</guid>
		<description><![CDATA[
IE7, don&#8217;t you just love it? What they gave us with one had in terms of CSS actually sort of working they took away with some of the stupidest niggly little bugs ever. Here&#8217;s another potentially large one i&#8217;m stumbled right into recently.
If your user agent string is more than 260 characters in length then [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://s322999261.websitehome.co.uk/wp-content/uploads/2008/07/header.jpg" alt="Internet Explorer 7 User Agent Bug (MSIE 6.0)" title="Internet Explorer 7 User Agent Bug (MSIE 6.0)" width="530" height="190" /></p>
<p>IE7, don&#8217;t you just love it? What they gave us with one had in terms of CSS actually sort of working they took away with some of the stupidest niggly little bugs ever. Here&#8217;s another potentially large one i&#8217;m stumbled right into recently.</p>
<p><strong>If your user agent string is more than 260 characters in length then your user agent string suddenly and almost magically becomes &#8220;Mozilla/4.0 (compatible; MSIE 6.0)&#8221;</strong></p>
<p>Not what you&#8217;d expect to happen. Now, I know what your thinking. Why on god&#8217;s earth would your user agent string BE that long. The answer is simple. Toolbars and Spyware.</p>
<p><span id="more-99"></span></p>
<h2>Toolbars and Spyware</h2>
<p>The <em>cool</em> thing about Windows is that toolbars, spyware and crapware in general can and do add pointless shit to your Internet Explorer user agent string via the registry. Sounds good doesn&#8217;t it. Now consider the following:</p>
<ol>
<li>Most store bough Windows PCs come pre-installed with tons of stupid toolbars and crapware</li>
<li>IE 7 isn&#8217;t much more secure than IE6 was in terms of spyware</li>
<li>Home users do not know or care about viruses and spyware</li>
</ol>
<p>With me?</p>
<h2>Try it yourself</h2>
<p>You can easily trigger this bug yourself by editing the registry. Fire up regedit and navigate to HKLM/Software/Microsoft/Windows/CurrentVersion/Internet Settings/5./0User Agent/Post Platform. Create a new string key and fill up full of crap (enough to pass the 260 character threshold)</p>
<p><img src="http://s322999261.websitehome.co.uk/wp-content/uploads/2008/07/regedit.jpg" alt="regedit" title="regedit" width="530" height="190" /></p>
<p>Next, close all instances of IE. Fire UP IE again and type the following into the address bar:</p>
<pre class="brush: js">javascript:alert(navigator.userAgent)</pre>
<p>Hit enter and IE7 should now tell you that it&#8217;s IE6. Awesome!</p>
<p>I firmly believe that this is one of the reasons behind problems such as the <a href="/web/2008/03/17/thickbox-31-ie7-positioning-bug/">thickbox positioning bug </a>that many people experience with IE7.</p>
<h2>The workaround?</h2>
<p>This is of course just another argument against relying on the user agent string to determine browser version. It really shouldn&#8217;t be done this way, yet it&#8217;s the method built into many JavaScript libraries including jQuery with it&#8217;s <a href="/web/2008/03/14/jquerybrowserversion-doesnt-recognise-ie7/">unreliable $.browser.version</a> property.</p>
<p>If you really need to know if a browser is IE6 or IE7 then use something more solid like object detection. Simply testing for something like the following would be a better option than extracting unreliable data from the user agent string</p>
<p>A possible patch below redefines the browser version as &#8220;7.0&#8243; only if the browser has already been identified as IE6 and the the presence of the XMLHttpRequest object suggests otherwise.</p>
<pre class="brush: js">if(jQuery.browser.msie &#038;&#038; parseInt(jQuery.browser.version) == 6 &#038;&#038; this.XMLHttpRequest) {
	jQuery.browser.version = "7.0"
}</pre>
<p>I&#8217;m thinking though that maybe this might not be bulletproof. If IE8 presents the same or similar &#8220;Hi i&#8217;m IE6!&#8221; behaviour then the above patch could incorrectly identify IE8 as IE7. This might not be as serious as IE7 vs. IE6 but it&#8217;s still an issue.</p>
<p>I just wish that Microsoft would put a bit more effort into writing good software. It&#8217;s not like they don&#8217;t have the resources.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamiethompson.co.uk/web/2008/07/23/an-ie7-bug-that-returns-msie-60-user-agent-string/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>jQuery ui.tabs, Themeroller and .ui-tabs-nav-item</title>
		<link>http://jamiethompson.co.uk/web/2008/07/22/jquery-uitabs-and-themeroller/</link>
		<comments>http://jamiethompson.co.uk/web/2008/07/22/jquery-uitabs-and-themeroller/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 11:52:36 +0000</pubDate>
		<dc:creator>Jamie Thompson</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery UI]]></category>

		<guid isPermaLink="false">http://jamazon.co.uk/?p=89</guid>
		<description><![CDATA[There currently an inconsistency between the jQuery UI tabs plugin and the CSS generated by Themeroller

The CSS includes rules for &#8220;.ui-tabs-nav-item&#8221; but these classes are never added to the list items by the plugin. Because they are unnecessary.
Simply changing the rules to &#8220;.ui-tabs-nav li&#8221; they way they should be brings it all into line again. [...]]]></description>
			<content:encoded><![CDATA[<p>There currently an inconsistency between the jQuery UI <a href="http://ui.jquery.com/functional_demos/#ui.tabs">tabs plugin</a> and the CSS generated by <a href="http://ui.jquery.com/themeroller">Themeroller</a></p>
<p><img src="http://s322999261.websitehome.co.uk/wp-content/uploads/2008/07/jquery-ui-themeroller.jpg" alt="" title="jquery-ui-themeroller" width="530" height="191" class="alignnone size-full wp-image-90" /></p>
<p>The CSS includes rules for &#8220;.ui-tabs-nav-item&#8221; but these classes are never added to the list items by the plugin. Because they are unnecessary.</p>
<p>Simply changing the rules to &#8220;.ui-tabs-nav li&#8221; they way they should be brings it all into line again. Except the extra specificity overrides the &#8220;.ui-tabs-selected&#8221; rules. These need changing to &#8220;.ui-tabs-nav li.ui-tabs-selected&#8221; and Bob&#8217;s your monkey&#8217;s uncle.</p>
<p>There doesn&#8217;t appear to be a whole lot of consistency (or good CSS) rolling around the JQuery UI project at the moment. Hopefully this will improve. I was of the belief that a theme could be &#8220;dropped onto&#8221; a jQuery UI app to simply re-skin it. This isn&#8217;t the case. Not yet at least.</p>
<p>For the time being I think i&#8217;ll be sticking to good old fashioned hand written CSS</p>
]]></content:encoded>
			<wfw:commentRss>http://jamiethompson.co.uk/web/2008/07/22/jquery-uitabs-and-themeroller/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery.getScript() does not cache</title>
		<link>http://jamiethompson.co.uk/web/2008/07/21/jquerygetscript-does-not-cache/</link>
		<comments>http://jamiethompson.co.uk/web/2008/07/21/jquerygetscript-does-not-cache/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 12:29:44 +0000</pubDate>
		<dc:creator>Jamie Thompson</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://jamazon.co.uk/?p=88</guid>
		<description><![CDATA[It occurred to me today that when using jQuery&#8217;s handy little .getScript method that each script request is appended by a timestamp appended to the querystring. This is great. A lot of the time this is exactly what you want as it ensures that no browser will ever serve up it&#8217;s own cache in preference [...]]]></description>
			<content:encoded><![CDATA[<p>It occurred to me today that when using jQuery&#8217;s handy little .getScript method that each script request is appended by a timestamp appended to the querystring. This is great. A lot of the time this is exactly what you want as it ensures that no browser will ever serve up it&#8217;s own cache in preference of the actual script from the actual server.</p>
<p><img src="http://s322999261.websitehome.co.uk/wp-content/uploads/2008/07/getscript.png" alt="jQuery.getScript" title="jQuery.getScript" width="530" height="190" /></p>
<p>But what if you just want to use .getScript to programatically include parts of your application logic only where necessary (aka <a href="http://en.wikipedia.org/wiki/Lazy_loading">Lazy Loading</a>), or you simply want to defer the execution of a non-essential plugin or two until a couple of seconds after the DOM becomes available. You&#8217;d want those scripts cached as if you&#8217;d hard-coded them into script tags right? I guess.</p>
<h2>Can&#8217;t Cache, Won&#8217;t Cache (with Ainsley Harriott)</h2>
<p>There&#8217;s no way you can send cache control options into getScript. It simply doesn&#8217;t accept any. getScript is merely a wrapper around .get which itself does not provide options for controlling caching. I&#8217;m not sure whether or not this is an oversight on the part of the developers. Feel free to shoot me down in flames if i&#8217;m spectacularly missing some glaringly obvious point here.</p>
<p>It&#8217;s not a problem though. .get is itslef just a simple wrapper around .ajax which publicly exposes all of jQuery&#8217;s AJAXy goodness. As such there&#8217;s absolutely no reason why you can&#8217;t just redefine JQuery.getScript to accept an optional boolean argument for cache control. That&#8217;s the beauty of jQuery.</p>
<h2>jQuery.getScript Redefined</h2>
<pre class="brush: js">$.getScript = function(url, callback, cache){
	$.ajax({
			type: "GET",
			url: url,
			success: callback,
			dataType: "script",
			cache: cache
	});
};
</pre>
<p>This won&#8217;t break any existing code which references the function as omitting the cache argument defaults caching to false as per the original functionality. But if you want to allow caching you now have that option.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamiethompson.co.uk/web/2008/07/21/jquerygetscript-does-not-cache/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Publish / Subscribe With jQuery</title>
		<link>http://jamiethompson.co.uk/web/2008/06/17/publish-subscribe-with-jquery/</link>
		<comments>http://jamiethompson.co.uk/web/2008/06/17/publish-subscribe-with-jquery/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 16:24:27 +0000</pubDate>
		<dc:creator>Jamie Thompson</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://jamazon.co.uk/?p=82</guid>
		<description><![CDATA[With a view to writing a jQuery UI integrated with the offline functionality of Google Gears i&#8217;ve been toying with some code to poll for network connection status using jQuery.
The Network Detection Object
The basic premise is very simple. We create an instance of a network detection object which will poll a URL at regular intervals. [...]]]></description>
			<content:encoded><![CDATA[<p>With a view to writing a <a href="http://jquery.com">jQuery</a> UI integrated with the offline functionality of <a href="http://gears.google.com">Google Gears</a> i&#8217;ve been toying with some code to poll for network connection status using jQuery.</p>
<h2>The Network Detection Object</h2>
<p>The basic premise is very simple. We create an instance of a network detection object which will poll a URL at regular intervals. Should these HTTP requests fail we can assume that network connectivity has been lost, or the server is simply unreachable at the current time.</p>
<pre class="brush: js">$.networkDetection = function(url,interval){
	var url = url;
	var interval = interval;
	online = false;
	this.StartPolling = function(){
		this.StopPolling();
		this.timer = setInterval(poll, interval);
	};
	this.StopPolling = function(){
		clearInterval(this.timer);
	};
	this.setPollInterval= function(i) {
		interval = i;
	};
	this.getOnlineStatus = function(){
		return online;
	};
	function poll() {
		$.ajax({
			type: "POST",
			url: url,
			dataType: "text",
			error: function(){
				online = false;
				$(document).trigger('status.networkDetection',[false]);
			},
			success: function(){
				online = true;
				$(document).trigger('status.networkDetection',[true]);
			}
		});
	};
};</pre>
<p>You can view the <a href="/sandbox/nwdetect/">demo here</a>. Set your browser to work offline and see what happens&#8230;. no, it&#8217;s not very exciting.</p>
<h2>Trigger and Bind</h2>
<p>What is exciting though (or at least what is exciting me) is the method by which the status gets relayed through the application. I&#8217;ve stumbled upon a largely un-discussed method of implementing a <a href="http://en.wikipedia.org/wiki/Pub/sub">pub/sub</a> system using jQuery&#8217;s trigger and bind methods.</p>
<p>The demo code is more obtuse than it need to be. The network detection object publishes &#8217;status &#8216;events to the document which actively listens for them and in turn publishes &#8216;notify&#8217; events to all subscribers (more on those later). The reasoning behind this is that in a real world application there would probably be some more logic controlling when and how the &#8216;notify&#8217; events are published.</p>
<pre class="brush: js">$(document).bind("status.networkDetection", function(e, status){
	// subscribers can be namespaced with multiple classes
	subscribers = $('.subscriber.networkDetection');
	// publish notify.networkDetection even to subscribers
	subscribers.trigger("notify.networkDetection", [status])
	/*
	other logic based on network connectivity could go here
	use google gears offline storage etc
	maybe trigger some other events
	*/
});</pre>
<p>Because of jQuery&#8217;s DOM centric approach events are published to (triggered on) DOM elements. This can be the window or document object for general events or you can generate a jQuery object using a selector. The approach i&#8217;ve taken with the demo is to create an almost namespaced approach to defining subscribers.</p>
<p>DOM elements which are to be subscribers are classed simply with &#8220;subscriber&#8221; and &#8220;networkDetection&#8221;. We can then publish events only to these elements (of which there is only one in the demo) by triggering a notify event on <strong>$(&#8220;.subscriber.networkDetection&#8221;)</strong></p>
<p>The <strong>#notifier</strong> div which is part of the .subscriber.networkDetection group of subscribers then has an anonymous function bound to it, effectively acting as a listener.</p>
<pre class="brush: js">$('#notifier').bind("notify.networkDetection",function(e, online){
	// the following simply demonstrates
	notifier = $(this);
	if(online){
		if (!notifier.hasClass("online")){
			$(this)
				.addClass("online")
				.removeClass("offline")
				.text("ONLINE");
		}
	}else{
		if (!notifier.hasClass("offline")){
			$(this)
				.addClass("offline")
				.removeClass("online")
				.text("OFFLINE");
		}
	};
});</pre>
<p>So, there you go. It&#8217;s all pretty verbose and my example isn&#8217;t at all exciting. It also doesn&#8217;t showcase anything interesting you could do with these methods, but if anyone&#8217;s at all interested to dig through the source feel free. All the code is inline in the head of the <a href="/sandbox/nwdetect/">demo page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jamiethompson.co.uk/web/2008/06/17/publish-subscribe-with-jquery/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Tips for Using JQuery with ASP.NET Ajax</title>
		<link>http://jamiethompson.co.uk/web/2008/06/09/tips-for-using-jquery-with-aspnet-ajax/</link>
		<comments>http://jamiethompson.co.uk/web/2008/06/09/tips-for-using-jquery-with-aspnet-ajax/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 08:21:20 +0000</pubDate>
		<dc:creator>Jamie Thompson</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://jamazon.co.uk/?p=78</guid>
		<description><![CDATA[Dave Ward has put together an excellent and extensive post on his experiences integrating jQuery with ASP.NET
There are the usual number of pitfalls you&#8217;d expect when integrating [insert widely-used microsoft technology here] with [insert useful open source technology here]
Want to consume a JSON Web Service with jQuery? Sounds simple. That&#8217;s kinda the point of JSON [...]]]></description>
			<content:encoded><![CDATA[<p>Dave Ward has put together an <a href="http://encosia.com/2008/06/05/3-mistakes-to-avoid-when-using-jquery-with-aspnet-ajax/">excellent and extensive post</a> on his experiences integrating jQuery with ASP.NET</p>
<p>There are the usual number of pitfalls you&#8217;d expect when integrating <em>[insert widely-used microsoft technology here]</em> with <em>[insert useful open source technology here]</em></p>
<p>Want to consume a JSON Web Service with jQuery? Sounds simple. That&#8217;s kinda the point of JSON right? Well yeah, but no. Everything&#8217;s workaroundable and to be fair it isn&#8217;t all Microsoft&#8217;s fault&#8230; ok so most of it is.</p>
<p>I&#8217;m gonna be starting a large scale ASP.NET / jQuery / ExtJS project in the very near future and Dave&#8217;s short guide has probably just saved me several hours if not a whole day of figuring out all the lumps and bumps myself.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamiethompson.co.uk/web/2008/06/09/tips-for-using-jquery-with-aspnet-ajax/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery Google Analytics Tracking API Integration (ga.js)</title>
		<link>http://jamiethompson.co.uk/web/2008/03/26/jquery-google-analytics-tracking-api-integration-gajs/</link>
		<comments>http://jamiethompson.co.uk/web/2008/03/26/jquery-google-analytics-tracking-api-integration-gajs/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 15:34:54 +0000</pubDate>
		<dc:creator>Jamie Thompson</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://jamazon.co.uk/web/2008/03/26/jquery-google-analytics-tracking-api-integration-gajs/</guid>
		<description><![CDATA[Jason Huck&#8217;s gaTracker jQuery plugin allows for unobtrusive integration of the Google Analytics tracker into a page as well as attaching tracking events to each external link, mailto and download. It works seamlessly but it does however currently use the old &#8216;urchin.js&#8217; which has been superceeded by Google&#8217;s new Tracking API (ga.js)
ga.js has all the [...]]]></description>
			<content:encoded><![CDATA[<p>Jason Huck&#8217;s <a href="http://plugins.jquery.com/project/gaTracker">gaTracker</a> jQuery plugin allows for unobtrusive integration of the Google Analytics tracker into a page as well as attaching tracking events to each external link, mailto and download. It works seamlessly but it does however currently use the old &#8216;urchin.js&#8217; which has been superceeded by Google&#8217;s new <a href="http://code.google.com/apis/analytics/docs/">Tracking API</a> (ga.js)</p>
<p>ga.js has all the capabilities of urchin.js but is structured in a fully Object oriented way. The new API has some nice new functionality which among other things allows for tracking of e-commerce transactions, which is pretty exciting. If you like that sorta thing.</p>
<p>I&#8217;ve quickly modified gaTracker to utilise the new API and call it&#8217;s _trackPageview() method rather than using urchinTracker(). The code is available below:</p>
<p><a href="/files/js/jquery.gatracker.js">jquery.gatracker.js</a> (Tracking API version)</p>
<p>It works in exactly the same way as the gaTracker 1.0.1 release, and can be dropped in it&#8217;s place, but utilises the new tracking API. Feel free to grab a copy until support gets built into the official release.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamiethompson.co.uk/web/2008/03/26/jquery-google-analytics-tracking-api-integration-gajs/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>jQuery Image Text Replacement: Work In Progress</title>
		<link>http://jamiethompson.co.uk/projects/2008/03/17/jquery-image-text-replacement-work-in-progress/</link>
		<comments>http://jamiethompson.co.uk/projects/2008/03/17/jquery-image-text-replacement-work-in-progress/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 23:19:37 +0000</pubDate>
		<dc:creator>Jamie Thompson</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://jamazon.co.uk/projects/2008/03/17/jquery-image-text-replacement-work-in-progress/</guid>
		<description><![CDATA[The JavaScript text replacement on this site is a jQuery Plugin i&#8217;ve written as an adaptation of the techniques detailed in Dynamic Text Replacement by Stewart Rosenberger in A List Apart Issue 183. The current source of the plugin can be found here. I&#8217;m calling it jitr, and you can&#8217;t stop me.
Currently it&#8217;s a work [...]]]></description>
			<content:encoded><![CDATA[<p>The JavaScript text replacement on this site is a jQuery Plugin i&#8217;ve written as an adaptation of the techniques detailed in <a href="http://www.alistapart.com/articles/dynatext">Dynamic Text Replacement</a> by <a href="http://www.alistapart.com/authors/r/stewartrosenberger">Stewart Rosenberger</a> in A List Apart Issue 183. The current source of the plugin can be found <a href="/files/js/jquery.jitr.js">here</a>. I&#8217;m calling it jitr, and you can&#8217;t stop me.</p>
<p>Currently it&#8217;s a work in progress and utilizes an extended version of Stewart&#8217;s <a href="http://www.alistapart.com/d/dynatext/heading.php.txt">Dynamic Heading Generator</a> PHP script. The plugin will attempt to replace the text of an element such as a heading with text generated in a specified font in the same colour and size as specified in the CSS. It will generate one image per word allowing word-wrap to occur.</p>
<p>There is currently a known issue with IE (all versions) when using jitr with em based font sizes. Internet Explorer reports a size which <strong>does not</strong> represent the equivalent font size in pixels.<br />
<span id="more-49"></span></p>
<h2>Syntax:</h2>
<p><code>jitr(String fontfilename, String backgroundColor)</code></p>
<p>jitr returns the jQuery object so that it can be chained.</p>
<p>There is currently however one major part of the process which lies outside of the plugin. To avoid a flicker of unstyled content on document.ready, it is necessary to include a stylesheet (hide.css) which sets the elements which are to be replaced to have &#8216;visibility: hidden&#8217;. As each element is image replaced, it&#8217;s CSS visibility is reset to visible.</p>
<h2>Example hide.css</h2>
<pre class="brush: css">h1, h2, h3 {
	visibility:hidden;
}</pre>
<p>Simply including this stylesheet in the head would have adverse side-effects for visitors without JavaScript though. The CSS above would hide all the headings and the plugin, not being run, would not then reset them to visible. I have decided for the time being that the only solution i can see which will work, although slightly clunky is to use a document.write to include hide.css only when JavaScript is enabled.</p>
<pre class="brush: js">&lt;script type="text/javascript"&gt;
    document.write('&lt;link rel="stylesheet" href="/path/to/hide.css" ' +
    'type="text/css" media="screen" /&gt;');
&lt;/script&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://jamiethompson.co.uk/projects/2008/03/17/jquery-image-text-replacement-work-in-progress/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Thickbox 3.1 IE7 Positioning Bug</title>
		<link>http://jamiethompson.co.uk/web/2008/03/17/thickbox-31-ie7-positioning-bug/</link>
		<comments>http://jamiethompson.co.uk/web/2008/03/17/thickbox-31-ie7-positioning-bug/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 13:20:26 +0000</pubDate>
		<dc:creator>Jamie Thompson</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Thickbox]]></category>

		<guid isPermaLink="false">http://jamazon.co.uk/web/2008/03/17/thickbox-31-ie7-positioning-bug/</guid>
		<description><![CDATA[
As previously mentioned in this post Thickbox 3.1 is currently broken in many revisions of Internet Explorer 7. Specifically, those revisions who return the substring &#8220;MSIE 6.0&#8243; in the user-agent string.
Update: July 2008
This patch fixes a problem caused when certain installations of IE7 are incorrectly identified as IE6 causing the thickbox window to be positioned [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://s322999261.websitehome.co.uk/wp-content/uploads/2008/07/thickbox.jpg" alt="thickbox" title="thickbox" width="530" height="191" /></p>
<p>As previously mentioned in <a href="http://jamazon.co.uk/web/2008/03/14/jquerybrowserversion-doesnt-recognise-ie7/">this post</a> <a href="http://jquery.com/demo/thickbox/">Thickbox</a> 3.1 is currently broken in many revisions of Internet Explorer 7. Specifically, those revisions who return the substring &#8220;MSIE 6.0&#8243; in the user-agent string.</p>
<h2>Update: July 2008</h2>
<p>This patch fixes a problem caused when certain installations of IE7 are incorrectly identified as IE6 causing the thickbox window to be positioned <strong>partially hidden</strong> in the <strong>top left hand corner</strong> of the viewport . It has become apparent that there are other bugs triggered in other revisions of IE7 which cause another type of miss-positioning with the thickbox window being <strong>centered </strong>correctly but <strong>outside of the viewport</strong>. <strong>This patch doesn&#8217;t fix that</strong></p>
<p>As this is such a widespread problem, and lots of people seem to be having a little difficulty patching their copies of thickbox.js I thought i&#8217;d provide a patched copy here. But first a bit of background for those who are interested in why it&#8217;s broken. The following if statement in the function tb_position is as follows:</p>
<h2>thickbox.js line 284</h2>
<pre class="brush: js">if ( !(jQuery.browser.msie &#038;&#038; jQuery.browser.version < 7)) { // take away IE6
    $("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
}</pre>
<p>The bug is triggered when, in certain revisions of IE7 jQuery.browser.version == 6, resulting in the Thickbox window not receiving the correct CSS positioning. (In IE6, the window receives it position through some clever CSS expressions in thickbox.css)<br />
<span id="more-47"></span><br />
The workaround for all this though is fairly straightforward. You simply need a more accurate way for weeding out IE6... and here it is.</p>
<h2>$.browser.msie6</h2>
<pre class="brush: js">$.browser.msie6 =
    $.browser.msie
    &#038;&#038; /MSIE 6\.0/i.test(window.navigator.userAgent)
    &#038;&#038; !/MSIE 7\.0/i.test(window.navigator.userAgent);</pre>
<p>Once we have this new property defined within the $.browser object we can use it to fix the conditional statement mentioned previously. You can define $.browser.msie6 in thickbox.js (like i have in the patched copies of thickbox below), or patch jQuery itself. Or whatever. It's up to you. After that all that needs to be done is to modify the following line to make use of our new IE6 sniffer:</p>
<h2>thickbox.js line 284</h2>
<pre class="brush: js">if ( !(jQuery.browser.msie6)) { // take away IE6
    $("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
}</pre>
<p>If you don't feel confident patching your own copy of thickbox then feel free to grab a patched copy below. This is thickbox 3.1 with the abovementioned code modifications applied and should simply replace your existing file.</p>
<ul>
<li><a href="/files/js/thickbox.patch.js">thickbox.patch.js</a></li>
<li><a href="/files/js/thickbox.patch.pack.js">thickbox.patch.pack.js</a></li>
</ul>
<p>Let me know if you find this useful</p>
]]></content:encoded>
			<wfw:commentRss>http://jamiethompson.co.uk/web/2008/03/17/thickbox-31-ie7-positioning-bug/feed/</wfw:commentRss>
		<slash:comments>126</slash:comments>
		</item>
		<item>
		<title>jQuery hide/show Safari Bug</title>
		<link>http://jamiethompson.co.uk/web/2008/03/17/jquery-hideshow-safari-bug/</link>
		<comments>http://jamiethompson.co.uk/web/2008/03/17/jquery-hideshow-safari-bug/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 10:32:50 +0000</pubDate>
		<dc:creator>Jamie Thompson</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://jamazon.co.uk/web/2008/03/17/jquery-hideshow-safari-bug/</guid>
		<description><![CDATA[I&#8217;ve noticed problems in Safari with the hide/show methods of jQuery on and off for quite a while now. Basically they don&#8217;t work. Correct me if i&#8217;m wrong. This behaviour also extends to the fadeIn/Out methods.
The problem can be circumvented to applying css rules directly to the element(s) in question.
// This will fail in Safari
$(element).hide()
// [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed problems in Safari with the hide/show methods of jQuery on and off for quite a while now. Basically they don&#8217;t work. Correct me if i&#8217;m wrong. This behaviour also extends to the fadeIn/Out methods.</p>
<p>The problem can be circumvented to applying css rules directly to the element(s) in question.</p>
<pre class="brush: js">// This will fail in Safari
$(element).hide()
// But this will work
$(element).css('display','none')
</pre>
<p>A quick google reveals that lot&#8217;s of people have come across this same issue, but no definitive answers.</p>
<blockquote>
]]></content:encoded>
			<wfw:commentRss>http://jamiethompson.co.uk/web/2008/03/17/jquery-hideshow-safari-bug/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

