<?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>Undisciplined Bytes &#187; browser</title>
	<atom:link href="http://www.undisciplinedbytes.com/category/browser/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.undisciplinedbytes.com</link>
	<description>Web Application Development Tips, Tricks and Techniques</description>
	<lastBuildDate>Tue, 31 Jan 2012 09:07:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JavaScript best practices II</title>
		<link>http://www.undisciplinedbytes.com/2011/02/javascript-best-practices-ii/</link>
		<comments>http://www.undisciplinedbytes.com/2011/02/javascript-best-practices-ii/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 10:35:08 +0000</pubDate>
		<dc:creator>Oliver Mezquita</dc:creator>
				<category><![CDATA[browser]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.undisciplinedbytes.com/?p=552</guid>
		<description><![CDATA[We’ve seen some basic recommendations we should all follow when writing  JavaScript. Now let’s go through some more:


Comment as much as needed, but no more: comment what you consider needed,  but don’t tell others your life story. Too many comments may make some other  developer get distracted from the actual code.
Javascript is [...]]]></description>
			<content:encoded><![CDATA[<p>We’ve seen some basic recommendations we should all follow when writing  JavaScript. Now let’s go through some more:</p>
<p><span id="more-552"></span></p>
<ul>
<li>Comment as much as needed, but no more: comment what you consider needed,  but don’t tell others your life story. Too many comments may make some other  developer get distracted from the actual code.</li>
<li>Javascript is used to define the behaviour, not the look &amp; feel: even  though there’s the possibility to set the appearance of your application through  JavaScript, you should leave that for CSS. Always follow the “separation of  concerns” mantra. A change in the icons or the color of borders shouldn’t  require dealing with JavaScript code.</li>
<li>Modularize: keep your code modularized and specialized. Make sure to write  smaller, generic helper functions that fulfill one specific task, rather than  catch-all methods.</li>
<li>Allow for configuration and translation: everything that is likely to change  in your code should not be scattered throughout the code, for example, labels,  CSS classes and IDs. By putting these into a configuration object and making it  public, we make maintenance very easy and allow for customization.</li>
<li>Access the DOM as little as possible: accessing the DOM in browsers is an  expensive thing to do. The DOM is a very complex API and rendering in browsers  can take up a lot of time. To make sure that your code is fast and doesn’t slow  down the browser to a halt try to keep DOM access to a bare minimum.</li>
<li>Build on the shoulders of giants: JavaScript libraries are specifically  built to make browsers behave as you would expect by plugging browser holes.  Therefore, if you want to write code that works without keeping the maintenance  overhead of supporting current browsers and those to come, start with a good  library.</li>
<li>Development code is not live code: live code is done for machines,  development code is done for humans. Make your code as readable and  understandable as possible. Then, before deploying your web application,  collate, minify and optimize your code in a build process.</li>
</ul>
<p>If you follow all these recommendations, you can be sure you’ll have produced  a high quality code that will be easy to maintain.</p>


<h4>Related posts:</h4><p><ol><li><a href='http://www.undisciplinedbytes.com/2011/01/javascript-best-practices-i/' rel='bookmark' title='Permanent Link: JavaScript best practices I'>JavaScript best practices I</a></li>
<li><a href='http://www.undisciplinedbytes.com/2009/10/javascript-frameworks-overview/' rel='bookmark' title='Permanent Link: Javascript frameworks overview'>Javascript frameworks overview</a></li>
<li><a href='http://www.undisciplinedbytes.com/2010/12/object-oriented-javascript-i-the-basics/' rel='bookmark' title='Permanent Link: Object Oriented JavaScript I: the basics'>Object Oriented JavaScript I: the basics</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.undisciplinedbytes.com/2011/02/javascript-best-practices-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript best practices I</title>
		<link>http://www.undisciplinedbytes.com/2011/01/javascript-best-practices-i/</link>
		<comments>http://www.undisciplinedbytes.com/2011/01/javascript-best-practices-i/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 12:43:41 +0000</pubDate>
		<dc:creator>Oliver Mezquita</dc:creator>
				<category><![CDATA[browser]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.undisciplinedbytes.com/2011/01/javascript-best-practices-i/</guid>
		<description><![CDATA[Now that we’ve seen the basic JavaScript concepts, we’ll go through some recommendations to make a good code. These are some practices that should be followed if you want to make a readable and maintainable code. It is based on my knowledge and experience of JavaScript over several years of practical experience:


Always use ‘var’: although [...]]]></description>
			<content:encoded><![CDATA[<p>Now that we’ve seen the basic JavaScript concepts, we’ll go through some recommendations to make a good code. These are some practices that should be followed if you want to make a readable and maintainable code. It is based on my knowledge and experience of JavaScript over several years of practical experience:</p>
<p><span id="more-548"></span></p>
<ul>
<li>Always use ‘var’: although it is not compulsory, the use of the ‘var’ keyword is always recommended. By using it, your code will execute faster, and you will avoid some potential problems.</li>
<li>Feature-detect rather than browser-detect: before using any advanced feature that an older browser may not support, check to see if the function or property exists first, instead of writing code to detect browser versions.</li>
<li>Avoid ‘eval’: the eval() function in JavaScript allows a programmer to run arbitrary code at run-time, by interpreting a string as if it was code. If it exists in your page, there is almost always a more correct way to accomplish what you are doing. “Eval is evil.&#8221; Don&#8217;t use it unless you are an experienced developer and know that your case is an exception.</li>
<li>Use unobstrusive JavaScript: now, this is an important one: HTML and JavaScript code should not be mixed together. You should always follow the “separation of concerns” mantra: HTML defines the structure and content of a web page, and JavaScript defines the behavior. Therefore, do not use inline event handlers. Attach your event-handling code by JavaScript. This way, you’ll improve readability and maintainability.</li>
<li>Avoid cluttering the global namespace: global variables and functions are rarely required. Using globals may cause naming conflicts between JavaScript source files and cause code to break. You should always use object oriented programming and write all your code in classes when writing JavaScript code.</li>
<li>Use JSON: when storing data structures as plain text or sending/retrieving data structures via Ajax, use JSON instead of XML when possible. JSON (JavaScript Object Notation) is a more compact and efficient data format, and is language-neutral.</li>
<li>Make you code understandable: choose easy to understand and short names for variables and functions. Think of your code as a story – a story that should be easy to read and understand, the names you choose shouldn’t make it more complicated.</li>
</ul>
<p>In my next post I’ll discuss some more recommendations. Stay tuned!</p>


<h4>Related posts:</h4><p><ol><li><a href='http://www.undisciplinedbytes.com/2011/02/javascript-best-practices-ii/' rel='bookmark' title='Permanent Link: JavaScript best practices II'>JavaScript best practices II</a></li>
<li><a href='http://www.undisciplinedbytes.com/2011/01/object-oriented-javascript-iii-some-tips/' rel='bookmark' title='Permanent Link: Object Oriented JavaScript III: some tips'>Object Oriented JavaScript III: some tips</a></li>
<li><a href='http://www.undisciplinedbytes.com/2010/12/object-oriented-javascript-i-the-basics/' rel='bookmark' title='Permanent Link: Object Oriented JavaScript I: the basics'>Object Oriented JavaScript I: the basics</a></li>
<li><a href='http://www.undisciplinedbytes.com/2009/10/javascript-frameworks-overview/' rel='bookmark' title='Permanent Link: Javascript frameworks overview'>Javascript frameworks overview</a></li>
<li><a href='http://www.undisciplinedbytes.com/2010/12/object-oriented-javascript-ii-the-pattern/' rel='bookmark' title='Permanent Link: Object Oriented JavaScript II: the pattern'>Object Oriented JavaScript II: the pattern</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.undisciplinedbytes.com/2011/01/javascript-best-practices-i/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GUI Testing</title>
		<link>http://www.undisciplinedbytes.com/2010/10/gui-testing/</link>
		<comments>http://www.undisciplinedbytes.com/2010/10/gui-testing/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 14:39:08 +0000</pubDate>
		<dc:creator>Oliver Mezquita</dc:creator>
				<category><![CDATA[browser]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.undisciplinedbytes.com/?p=453</guid>
		<description><![CDATA[A very important thing you must do before releasing your web application into the wild is some sort of Graphical User Interface Testing. This kind of testing ensures that the interfaces between the client and servers execute in tandem. It is an important factor that these connections or interfaces work seamlessly without any failure or [...]]]></description>
			<content:encoded><![CDATA[<p>A very important thing you must do before releasing your web application into the wild is some sort of <strong>Graphical User Interface Testing</strong>. This kind of testing ensures that the interfaces between the client and servers execute in tandem. It is an important factor that these connections or interfaces work seamlessly without any failure or degradation in performance of speed and accuracy. The testing should also check for appropriate error messages. So, you must design these tests not only to check whether your application works as expected, but also to ensure that the performance is good enough.</p>
<p><span id="more-453"></span></p>
<p>GUI testing can cover applications areas that don’t have unit tests. It might be easier and require less time to write GUI tests rather than unit tests. But this approach is not recommended. If you’re serious about the quality of your products, then you should plan to <strong>write both unit tests and GUI tests</strong>. The reason is that GUI testing has a different domain and tries to find different kinds of errors than unit testing. GUI testing will find the parts of your applications that work in some web browsers but won’t behave correctly in some other web browsers (as IE, for example). Some other features that are normally tested include the loading and performance of the site along with the links, website security and log analysis.</p>
<p>In GUI functional testing, you can make use of a tool that will allow you to create tests that can mimic the activities or actions and the assessments of the actual human testers. This will help you get better results and be able to improve your website&#8217;s interface. You will also have this tool performing the tests whenever you tell it to. I like to configure my tests to be run nightly, so when I come in the morning I have a list of which tests passed and which ones I have to take a look at.</p>
<p>GUI testing tools assist test engineers with regard to recording test scripts, inserting verification points, and testing data:</p>
<ul>
<li>When capture/playback is turned on, it can record/reproduce the actions performed by a real person. It saves testers from writing test scripts by hand.</li>
<li>Testing tools also have tests harnesses to manage the automated test scripts. Testers can use the available harnesses to schedule testing executions and manage effective regression testing by reusing the script library.</li>
<li>Testers can use these tools as learning assistants. Testers can use the tool to learn the properties of different GUI components and learn how to operate different GUI components programmatically.</li>
</ul>
<p>So, if you haven’t tried GUI testing yet in your web app, get to it ASAP. If you don’t know which GUI testing tool to use, give <a href="http://seleniumhq.org/" target="_blank">Selenium</a> a try. Selenium provides a record/playback tool for authoring tests without learning a test scripting language. Selenium provides a test domain specific language (DSL) to write tests in a number of popular programming languages, including C#, Java, Ruby, Groovy, Python, PHP, and Perl. Test playback is possible in most modern web browsers. Selenium deploys on Windows, Linux, and Macintosh platforms.</p>
<p>Selenium is quite known and is the one I use, so I totally recommend it. However, if you want to check out some other tools of this kind, you have a <a href="http://en.wikipedia.org/wiki/List_of_GUI_testing_tools" target="_blank">list at Wikipedia</a>.</p>


<h4>Related posts:</h4><p><ol><li><a href='http://www.undisciplinedbytes.com/2010/07/improving-software-quality-automatic-testing/' rel='bookmark' title='Permanent Link: Improving software quality: automatic testing'>Improving software quality: automatic testing</a></li>
<li><a href='http://www.undisciplinedbytes.com/2010/10/load-testing/' rel='bookmark' title='Permanent Link: Load testing'>Load testing</a></li>
<li><a href='http://www.undisciplinedbytes.com/2010/08/unit-testing/' rel='bookmark' title='Permanent Link: Unit testing'>Unit testing</a></li>
<li><a href='http://www.undisciplinedbytes.com/2011/07/test-driven-development/' rel='bookmark' title='Permanent Link: Test-driven development'>Test-driven development</a></li>
<li><a href='http://www.undisciplinedbytes.com/2009/10/browser-comparisons/' rel='bookmark' title='Permanent Link: Browser comparisons'>Browser comparisons</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.undisciplinedbytes.com/2010/10/gui-testing/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Browser comparisons</title>
		<link>http://www.undisciplinedbytes.com/2009/10/browser-comparisons/</link>
		<comments>http://www.undisciplinedbytes.com/2009/10/browser-comparisons/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 23:16:11 +0000</pubDate>
		<dc:creator>Oliver Mezquita</dc:creator>
				<category><![CDATA[browser]]></category>

		<guid isPermaLink="false">http://www.undisciplinedbytes.com/?p=24</guid>
		<description><![CDATA[More comparisons among browsers&#8230; Six Revisions has performed some tests to the most important browsers.
The tools used to perform these tests are:

SunSpider JavaScript Benchmark
SlickSpeed (jQuery values reported)
Numion stopwatch
CSS Rendering Benchmark
Resource Monitor

And this is the result they came up with:

Nothing really surprising here&#8230; Google Chrome seems to reign in most categories, specially in Javascript execution speed. [...]]]></description>
			<content:encoded><![CDATA[<p>More comparisons among browsers&#8230; <a href="http://sixrevisions.com/infographics/performance-comparison-of-major-web-browsers/">Six Revisions has performed some tests to the most important browsers.</a><br />
The tools used to perform these tests are:</p>
<ul>
<li>SunSpider JavaScript Benchmark</li>
<li>SlickSpeed (jQuery values reported)</li>
<li>Numion stopwatch</li>
<li>CSS Rendering Benchmark</li>
<li>Resource Monitor</li>
</ul>
<p>And this is the result they came up with:</p>
<p><span id="more-24"></span></p>
<div id="attachment_25" class="wp-caption aligncenter" style="width: 270px"><a href="http://www.undisciplinedbytes.com/wp-content/uploads/2009/10/15-03_performance_comparison_of_web_browsers_large.jpg" target="_blank"><img class="size-medium wp-image-25 " title="15-03_performance_comparison_of_web_browsers_large" src="http://www.undisciplinedbytes.com/wp-content/uploads/2009/10/15-03_performance_comparison_of_web_browsers_large-260x300.jpg" alt="Performance comparison of web browsers" width="260" height="300" /></a><p class="wp-caption-text">Performance comparison of web browsers</p></div>
<p>Nothing really surprising here&#8230; Google Chrome seems to reign in most categories, specially in Javascript execution speed. This makes it the most suitable browser to use in our web apps, with increasingly heavy usage of Javascript.<br />
Nice post to have handy to help you make your point why IE should be considered as a <em>toy</em> browser, not a professional tool.</p>


<h4>Related posts:</h4><p><ol><li><a href='http://www.undisciplinedbytes.com/2009/10/tired-of-ies-issues-turn-it-into-google-chrome/' rel='bookmark' title='Permanent Link: Tired of IE&#8217;s issues? Turn it into Google Chrome'>Tired of IE&#8217;s issues? Turn it into Google Chrome</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.undisciplinedbytes.com/2009/10/browser-comparisons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tired of IE&#8217;s issues? Turn it into Google Chrome</title>
		<link>http://www.undisciplinedbytes.com/2009/10/tired-of-ies-issues-turn-it-into-google-chrome/</link>
		<comments>http://www.undisciplinedbytes.com/2009/10/tired-of-ies-issues-turn-it-into-google-chrome/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 22:17:42 +0000</pubDate>
		<dc:creator>Oliver Mezquita</dc:creator>
				<category><![CDATA[browser]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.undisciplinedbytes.com/?p=14</guid>
		<description><![CDATA[As web programmers, we've all dealed with IE's uncompatibility issues and its sluggishness, and I can assure that 99% of all of us are tired of how stubborn Microsoft is about not implementing web standards and trying to enforce its own private ways of doing things (although with the release of Internet Explorer 8 Microsoft has showed a bit of effort in trying to be more standards compliant). How much time have we wasted on writing workarounds for IE for code that works seamlessly in other browsers?

Well, Google seems to be worried about this as well, and now gives us one more possibility to solve the problem: turn Internet Explorer into Google Chrome.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">As web programmers, we&#8217;ve all dealed with IE&#8217;s incompatibility issues and its sluggishness, and I can assure that 99% of all of us are tired of how stubborn Microsoft is about not implementing web standards and trying to enforce its own private ways of doing things (although with the release of Internet Explorer 8 Microsoft has showed a bit of effort in trying to be more standards compliant). <strong>How much time have we wasted on writing workarounds for IE for code that works seamlessly in other browsers?</strong></p>
<p style="text-align: justify;">Well, Google seems to be worried about this as well, and now gives us one more possibility to solve the problem: <strong>turn Internet Explorer into Google Chrome</strong><strong>.</strong></p>
<p><span id="more-14"></span></p>
<p style="text-align: justify;">Google just released its new plugin for IE: <strong>Google Chrome Frame</strong>. This plugin substitutes the HTML and Javascript engines from IE with the ones from Google Chrome. This way we&#8217;ll be able to enjoy Chrome&#8217;s speed and compatibility.</p>
<p style="text-align: justify;">I was surprised when I tried: it is exactly as having the Google Chrome browser inside IE. You can tell no difference between the real Google Chrome browser and the plugin installed in Microsoft&#8217;s browser.</p>
<p style="text-align: justify;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="437" height="263" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/sjW0Bchdj-w&amp;hl=es&amp;fs=1&amp;hd=1&amp;border=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="437" height="263" src="http://www.youtube.com/v/sjW0Bchdj-w&amp;hl=es&amp;fs=1&amp;hd=1&amp;border=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p style="text-align: justify;">Now, this plugin doesn&#8217;t fully replace IE&#8217;s HTML and Javascript engines: it just sits there waiting to be called, which can be done in two ways.</p>
<p style="text-align: justify;">The user can decide which pages he/she wants displayed by Chrome Frame by inserting <code>cf:</code> right before of the URL address. This is, if you type  <code>http://www.undisciplinedbytes.com</code> in IE&#8217;s address bar, it will be displayed normall, as always. But if you write <code>cf:http://www.undisciplinedbytes.com</code>,  then Chrome Frame will be in charge of rendering the page to you.</p>
<p style="text-align: justify;">Besides, a web developer might want to force a web page to be displayed using this plugin, as long as it is installed on the client&#8217;s computer. If you add this tag to the <code>HEAD</code> section of a web page, Chrome Frame will be activated:</p>
<p style="text-align: justify;"><code>&lt;meta http-equiv="X-UA-Compatible" content="chrome=1" /&gt;</code></p>
<p style="text-align: justify;">If Chrome Frame is installed, it will recognize this tag and realize it&#8217;s being requested to start working. If it is not installed, other browsers will just ignore the tag and behave as if it wasn&#8217;t there.</p>
<p style="text-align: justify;">Furthermore, the plugin extends the <code>User Agent</code> string with the keyword <code>chromeframe</code>. This means that we as web developers will be able to figure out whether Chrome Frame is installed or not, and take different actions in different situations.</p>
<p style="text-align: justify;"><a href="http://code.google.com/intl/en-US/chrome/chromeframe/" target="_blank">This is the official web page</a> of the project.</p>
<p style="text-align: justify;">Noble intentions Google has, no doubt about it. Great way of solving the limitations of legacy browsers and improving the usability of the web.</p>
<p style="text-align: justify;">However, as good as all this sounds, we do have to be careful when using this plugin. We need to realize that there are many web applications that have been developed with IE in mind, or even straight targetting Microsoft&#8217;s browser. This means that we need to activate Chrome Frame <strong>only</strong> on those pages that we have previously tested that work fine in Google Chrome. <strong>We cannot just put the meta tag in all of our web pages and forget about everything else!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.undisciplinedbytes.com/2009/10/tired-of-ies-issues-turn-it-into-google-chrome/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

