<?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>Java-ScriptGate.com</title>
	<atom:link href="http://www.java-scriptgate.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.java-scriptgate.com</link>
	<description>Java Script Is Difficult</description>
	<lastBuildDate>Sat, 04 Sep 2010 12:17:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>ECMAScript 5&#8242;s Date Extensions</title>
		<link>http://www.java-scriptgate.com/ecmascript-5s-date-extensions.html</link>
		<comments>http://www.java-scriptgate.com/ecmascript-5s-date-extensions.html#comments</comments>
		<pubDate>Thu, 07 Jan 2010 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2010/01/07/ecmascript5-date</guid>
		<description><![CDATA[One of the changes that ECMAScript 5 introduces is extensions to the Date class.  Some of these are very useful &#8212; Date.now and Date.UTC as well as ISO-8601 format support.
Michael J. Ryan has written support for these API changes in DateExtension...]]></description>
			<content:encoded><![CDATA[<a href="http://technosofts.in/">SEO Service Company India</a> - We provide ethical search engine optimisation services to companies world wide. Contact us to get high quality seo services at affordable prices.

One of the changes that ECMAScript 5 introduces is extensions to the <code>Date</code> class.  Some of these are very useful — <code>Date.now</code> and <code>Date.UTC</code> as well as <span class="caps">ISO</span>-8601 format support.

Michael J. Ryan has written support for these <span class="caps">API</span> changes in <a href="http://frugalcoder.us/post/2010/01/07/EcmaScript-5s-Date-Extensions.aspx">DateExtensions.js</a> so you can get started using them now.

<a href="http://www.internetmarketingcompany.biz/">Internet Marketing Company</a>

<a href="http://www.elmconsulting.org"><strong>SEO Consulting</strong></a> - With the most effective affordable SEO packages services in New York, ELM Consulting is the leader in helping small business grow on the web. Click here to learn more about our affordable SEO packages services and much more.

<a href="http://www.basariyorum.com/">redesign website</a>

Basariyorum is a leading web solution company catering to all your

website design and development needs there by helping your business

grow.

Usage looks like this:
<div class="highlight">
<pre><span class="kd">var</span> <span class="nx">epoch1</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="p">(</span><span class="s2">"1970-01-01T00:00:00.000Z"</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">epoch2</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>

<span class="k">if</span> <span class="p">(</span><span class="nx">epoch1</span><span class="p">.</span><span class="nx">getTime</span><span class="p">()</span> <span class="o">==</span> <span class="nx">epoch2</span><span class="p">.</span><span class="nx">getTime</span><span class="p">())</span>
    <span class="nx">alert</span><span class="p">(</span><span class="s2">"Epochs match!"</span><span class="p">);</span>

<span class="nx">alert</span><span class="p">(</span><span class="nx">epoch1</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span> <span class="c">//localized date instance of the JS epoch</span>
<span class="nx">alert</span><span class="p">(</span><span class="nx">epoch2</span><span class="p">.</span><span class="nx">toISOString</span><span class="p">());</span> <span class="c">// "1970-01-01T00:00:00.000Z"</span>
<span class="nx">alert</span><span class="p">(</span><span class="nx">epoch1</span> <span class="k">instanceof</span> <span class="nb">Date</span><span class="p">);</span> <span class="c">// true</span>
<span class="nx">alert</span><span class="p">(</span><span class="nb">Date</span><span class="p">.</span><span class="nx">UTC</span><span class="p">(</span><span class="mi">1970</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mi">1</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mi">0</span><span class="p">));</span> <span class="c">// 0</span></pre>
</div>
<h3>More on ECMAScript</h3>
Other ECMAScript 5 extensions to the base library include:
<ul>
	<li><code>bind()</code> that works like <a href="http://www.prototypejs.org/api/function/bind">Prototype’s bind</a></li>
	<li>A <span class="caps">JSON</span> object that supports parsing and generation</li>
	<li>New object/property extensions: <a href="http://ejohn.org/blog/ecmascript-5-objects-and-properties/">ECMAScript 5 Objects and Properties</a></li>
	<li>String now has a <code>trim()</code> method</li>
	<li><code>Array</code> gets useful methods like <code>filter()</code> and <code>map()</code></li>
</ul>
You can read a <span class="caps">PDF</span> of the spec here: <a href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf"><span class="caps">ECMA</span>-262.pdf</a>

<a href="http://freeautoresponders.services.officelive.com/">Free Autoresponders</a> - Welcome to Free autoresponders services officelive webpage. We offer to download a free email autoresponders software you can use for gmail, outlook and other email services.

<a href="http://www.designerevaluation.com/web-design/">Web Design</a> - Web Design offers custom web design, website development, flash website, portal development, search engine optimization and website designing services.

<a style="text-decoration: none;" href="http://situs-bebas.info">situs-bebas.info - free download</a>

<a href="http://business.hughesnet.com/services/business-internet/business-internet-with-vpn">Business VPN</a> - HughesNet Business Solutions provides business VPN, virtual private network, business internet with vpn, setting up vpn, satellite vpn for small and medium businesses, affordable and flexible, available anywhere.

<a href="http://www.numbertalk.co.uk/">0800 Numbers</a> - Providers of a wide range of business numbers starting from 0845, 0800, 0844, 0870, 0300, 0330, regional and international numbers.

<a href="http://www.03talk.com/">Conference Call</a> - No need to pay for Conference Calls any longer? Create a free, permanent Conference Room at 03TALK &amp; pay no more.

<a href="http://www.numberstore.com/">0845 Numbers</a> - Specialists in 0845 Numbers, 0800 Freephone Numbers, 0808 Numbers, Geographic and Non Geographic Numbers, Premium Rate Numbers and more. Visit the best online Number Store now.

<a href="http://bng.co.in/Transport.html">Transport Software</a>

Transport software has details of consignment, lorry hire, unloading or delivery. Transportation &amp; Logistics Software also related with retail software, manufacturing software, ERP software, retail management, POS retail software, retail business software, production planning control PPC, human resource and payroll, sales force automation, point of sale software company, point of sale software for small business, retail point of sale solutions.

<a href="http://www.designarcade.com/">Custom Web Design</a>-  Custom Website Design Services India Including Website Redesign and Ecommerce Solutions.A leading Web Design and Web Application Development Company in India, that specializes in Low Cost,Professional and Custom Website Design.

<a href="http://www.businessprodesigns.com/">Website Designs</a> - Affordable &amp; Professional Custom web site designing, Website development with Search Engine Optimization Services and content writing services from a 9001:2000 certified complete web solutions provider.

<a href="https://www.improvemydata.com/pages/common/page.aspx?name=address-management"></a>

<a href="https://www.improvemydata.com/pages/common/page.aspx?name=address-management"> </a>

<a href="https://www.improvemydata.com/pages/common/page.aspx?name=address-management">Best address management services</a> - Are you looking to hire best address management services. Your search ends here. Hire Improvemydata.com and get Consumer Data Cleansing &amp; Address Management Service. Call us at 0845 60 60 609 or visit Improvemydata.com now!

<a href="http://www.q3tech.com/">Offshore Product development</a> - Q3 Technologies is Offshore Product Development Company leading in Outsourced product development, Offshore Product Development India, Outsourced product development India, software development, Application Development and Enterprise Applications Development Services.

<a href="http://www.flashcoms.com"> cam chat </a> - Flashcoms is a reliable developer of flash-based interactive software designed to provide live communication support for websites and web-based communities.

<a href="http://www.iexpertsforum.com/top-seo-tools.html" target="_blank">SEO Tools</a> Read SEO Tools Reviews &amp; Compare SEO Softwares for IBP, Web CEO &amp; SEO Elite. SEO Software Reviews are rated by professional SEO Expert on the basis of customer reviews.

<a href="http://www.imaginationworks.org/">Step and repeat</a>

<a href="http://www.topfivecomputers.com/" target="_blank">buy computers</a> TopFiveComputers.com is a user friendly computer product review and comparison site for computers and related items. The site was created by Lorenzo Loero, a CompTIA A+ certified IT technician based out of Orlando, FL. The main focus is to give novice computer shoppers the information they need to make purchasing decisions.

<a href="http://www.internetadvantage.com/servicios/seo-posicionamiento-buscadores/" target="_blank">posicionamiento paginas web</a> Aparece en los Primeros Resultados de los Buscadores a través del servicio de Posicionamiento SEO de Internet Advantage y aumenta la visibilidad de tu Web

<a href="http://www.e2solutions.net/website_design_company_india.htm" target="_blank">Web Design India</a> E2 Solutions, India's leading web design company offering top quality website designing services at affordable prices.

<a title="Hosting" href="http://www.webhostingbuzz.com" target="_blank">Hosting</a> - Web Hosting Buzz provides Reseller Web Hosting, cheap shared website hosting, virtual private server (VPS), managed dedicated servers and hosting on reliable high performance reseller hosting server, virtual hosting solutions, semi-dedicated and business hosting accounts home.php

<a title="Ancestry Search" href="http://radaris.com/" target="_blank">Ancestry Search</a> - Radaris people search engine allows you to find and track anyone online. Our records contain current addresses, phone numbers and more.

<a title="People Search" href="http://comfibook.com/" target="_blank">People Search</a> - Online Address Book &amp; People Search allow you to store  all your contacts, find people by name, address, etc. Comfibook helps to connect people!

<a href="http://justhostcouponreview.com/">Justhost reviews</a> - Best reviews of justhost hosting plan.

<a href="http://www.webpromotionerindia.com/link_building_service_india.htm">Link building company india</a> - cheapest SEO Company in India offers free SEO consultation and Search Engine Optimization.

<a href="http://www.thenerds.net"> Laser  Printers</a> -  Thenerds.net offers great pricing on all ink  cartridge, ink toner, laser printers, gps navigation, portable gps, office  furniture, notebooks, hard drives, laptops, networking, systems and  digital  cameras.

<span style="color: #888888;"> </span>

<a href="http://www.pupdogtraining.com/dog-pet-insurance.html">Dog Insurance</a>

<a href="http://www.dynasis.com/webhosting/">Atlanta IT Consulting</a>-  DynaSis, take care of all your Business Technology and IT Management Solutions needs.

<a href="http://www.usatinc.com">Custom Software Applications</a>-  Custom software development, consulting and data  integration services. Should you buy or build a custom application?  Contact us for FREE professional IT expert advise.

<a href="http://www.pink-laptop.org.uk/">Pink Laptops</a>

<a href="http://www.seodepthcompany.com/link_building.html">Professional Link Building Company</a> - Link Building Company: Professional Link Building Company in India provides  Professional Link Building Service. A Link Building Company with fully  Professional Link Builders offering One Way, Reciprocal and Triangular Linking  Services at affordable  price

<a title="link building services" href="http://www.webs4soft.com/" target="_blank">link building services</a> - Award winning SEO Link Building Services. Vertical Measures is top rated Internet marketing company helping businesses. get more website traffic via higher search engine rankings, link building, social media, local search, and search engine optimization.

<a href="http://www.snowflakecreative.co.uk/" target="_blank">Web Design Hampshire</a> - Web Design in Basingstoke, Hampshire. Web design and graphic design agency covering Basingstoke, Hampshire and UK.

<a href="http://www.britishlogodesign.co.uk/" target="_blank">business logo design</a> - britishlogodesign.co.uk. Custom Logo Design specialists with Business Logo Design and Company Logo Design in the UK. Corporate custom logo design packages at an affordable rate.

<a href="http://www.online-marketing-agentur.ch/" target="_blank">Suchmaschinenoptimierung</a> - Online Marketing Agentur - Erschwingliche Suchmaschinenoptimierung (SEO) von einem Online-Service Internet-Marketing-Unternehmen. SEO SEO Company Services Schweiz von einer professionellen SEO Zürich. Outsource SEO Dienstleistungen in die Schweiz SEO.

<a href="http://www.links-builder.com/buylinks/index.php">Improve web site search engine rankings with high quality relevant links</a>-  Buy high quality, relevant text links from us and improve your website search engine rankings.

<a href="http://www.seodesignsolutions.com/seo-services.html">SEO service</a>

<a href="http://www.novelaspect.com">Quickbooks Hosting - Access Quickbooks Anytime, Anywhere</a>-  NovelAspect is a trusted leader in Quickbooks Web Hosting Services. They are the most reliable, and fully-licensed desktop QuickBooks hosting provider. Their QuickBooks Hosting provides unlimited remote user capability and every feature available on the local PC.

<a href="http://www.go4customer.com/">Call Center India</a> - India homes largest number of qualified, IT literate, tech-savvy and skilled professionals; large number of companies which Outsource Call Center in India. Call Center Service in India not only saves in the total expenditure but allows companies to have a more organized approach for process they outsource.

<a href="http://www.w3origin.com/">SEO India</a> - We are New Delhi, India based internet marketing services company believe in ethical SEO. Get top ranking on Google with transactional keywords

<a href="http://www.webdesignerscotland.com/">Web design</a> - Ecommerce and Web Design by one of Scotlands leading digital marketing companies.  Offering customised business web site design, internet marketing and promotion.

<a href="http://www.internetmarketingscotland.com/">Search engine optimisation</a> - Guaranteed SEO offered by expert Internet Marketing company. The SEO guarantee is simple. You receive a minimum of 25% more traffic or you pay nothing, Search engine optimisation.

<a href="http://www.internetpositions.com/">Search Engine Optimization Company</a> - Internet marketing company providing the worlds best SEO to businesses throughout North America.

<a href="http://vpshostings.com/">vps hosting</a>
]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/ecmascript-5s-date-extensions.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drawter</title>
		<link>http://www.java-scriptgate.com/drawter.html</link>
		<comments>http://www.java-scriptgate.com/drawter.html#comments</comments>
		<pubDate>Wed, 06 Jan 2010 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2010/01/06/drawter</guid>
		<description><![CDATA[Drawter by Damian Wielgosik is a simple tool for drawing HTML interfaces and exporting the results.  It uses jQuery and Damian&#8217;s own GUI code.
You can draw HTML tags using The Tagname to draw option and the mouse.  To switch between drawing and ...]]></description>
			<content:encoded><![CDATA[<img src="http://dailyjs.com/images/posts/drawter.png" alt="" />

<a href="http://drawter.com/">Drawter</a> by <a href="http://ferrante.pl">Damian Wielgosik</a> is a simple tool for drawing <span class="caps">HTML</span> interfaces and exporting the results.  It uses jQuery and Damian’s own <span class="caps">GUI</span> code.

You can draw <span class="caps">HTML</span> tags using The <em>Tagname to draw</em> option and the mouse.  To switch between drawing and editing content and <span class="caps">CSS</span>, use the <em>Draw Mode</em> and <em>Edit</em> buttons.  There are also menu items at the top of the page — click <em>Code</em> then <em>Generate code</em> to export your design.

Drawter is a great example of what can be done with JavaScript, but it’s also potentially a useful tool.  The author of <a href="http://konigi.com/notebook/drawter-drawable-markup-language">Konigi</a> was already blown away by it, and he’s something of a web prototyping tool enthusiast.

<a href="http://www.askpcexperts.ca">online computer support</a>

Best Remote Computer Repair Services with Ask PC Experts on

1-888-518-9191. Online Computer Support Specialists &amp; Remote PC Repair,

We fix computer problems remotely and provide Online PC troubleshooting

Help &amp; Online Computer Tech Support Help to USA, UK, Canada, Australia

and other English Speaking Countries.

<a href="http://www.askpcexperts.net"> computer support</a>

Computer Support Specialists &amp; Remote PC Repair in Australia. We

fix computer problems remotely and provide Online PC troubleshooting

Help &amp; Online Computer Tech Support.

<a href="http://www.intuitsolutions.net">ProStores Ecommerce Design, Customization &amp; SEO/a&gt;  from IntuitSolutions, the Ecommerce experts.</a>
<table style="height: 22px;" border="0" cellspacing="0" cellpadding="0" width="1"><col width="339"></col>
<tbody>
<tr height="20">
<td width="339" height="20"></td>
</tr>
</tbody>
</table>
<a href="http://www.ghacks.net/2009/06/04/pc-remote-access/" target="_blank">Remote Pc Access</a>

<a href="http://www.flashdevs.com/ ">flash game development</a>

<a href="http://www.visualsindia.com/">Web Design Company Chennai</a> - Visuals India - Web design and Development Company Chennai and SEO company. If you need our services then visit visualindia.com .

When it comes to finding a reliable marketing partner the printing company <a href="http://www.originalimpressions.com" target="_blank">http://www.originalimpressions.com</a>performs outstandingly as can be expected from a top tier supplier.

<a href="http://www.softsolutionsindia.net" target="_blank">Search Engine Optimization</a> - India SEO company providing search engine optimization,manual directory submission,search engine submission, internet marketing,custom website designing, affordable websites,website maintenance, software development.

<a href="http://www.idera.com/Products/SharePoint/SharePoint-migration-suite/">Sharepoint Migration</a> - Idera SharePoint migration suite is the most comprehensive solution available for SharePoint content migration.

<a href="http://www.indyadomains.com/">Domain Registration India</a> - Indyadomains.com - Cheap and professional support services on Domain Registration and Web Hosting Chennai, India.

<a href="http://www.broadconnect.ca/">IP Telephone Systems</a> - We provide reliable IP telephone systems and we are the leading provider of pure IP telephony solutions worldwide.

If you’re preparing for retirement in Ontario, OHIP may not be enough, since it does not cover some medications as well as extensive treatment. Consider individual <a href="http://www.kanetix.ca/health-insurance">health insurance Ontario</a> options which will help you medical expenses you may encounter.

<a href="http://www.askpcexperts.com/">Computer support</a> - Computer support services can troubleshoot networking issues, software programs, computer fixing and maintenance. Computer support services also provides you with expert consultation on technical isssues.

<a href="http://www.pcnames.com/">domain name search</a>

<a href="http://www.trakpro.com.au/real-time-vehicle-tracking.html">Real Time GPS Vehicle Tracking System</a> - TrakPro is the leading real time vehicle tracking system providing company. We provide comprehensive vehicle tracking and telematics to transportation industry to keep you one step ahead from your competitors.

<strong>Blue Delight Web Promotion Pvt. Ltd</strong> known as a <strong><a href="http://www.bluedelightconsultant.com/">
SEO Services Company</a></strong> and leading for organic, affordable &amp; ethical Search Engine Optimization.

B2B <strong><a href="http://www.b2binternetmarketingcompany.com/">Internet Marketing Company</a></strong> is known as bunch of various online services like web promotion, web designing, <strong>Search Engine Marketing</strong> services using some marketing strategies which include SEO, PPC and SEM for development of website.

Professional    SEO Services - Providing affordable organic <a href="http://www.seoonlineshop.com" alt "seo services">SEO Services</a> - SEO consultancy    services and Directory Submission, <a href="http://www.seoonlineshop.com/link_building.html" alt "link building">Link Building</a>, Article Submission and    Search Engine Optimization.
]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/drawter.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSpec</title>
		<link>http://www.java-scriptgate.com/jspec.html</link>
		<comments>http://www.java-scriptgate.com/jspec.html#comments</comments>
		<pubDate>Tue, 05 Jan 2010 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2010/01/05/jspec</guid>
		<description><![CDATA[We recently posted a unit test roundup, so I noticed that JSpec has been updated to version 3.  This version introduces several interesting updates (see the full change list):

	Rhino&#8217;s jar is included so console tests can work without installing...]]></description>
			<content:encoded><![CDATA[We recently posted a <a href="http://dailyjs.com/2009/12/30/unit-testing/">unit test roundup</a>, so I noticed that <a href="http://github.com/visionmedia/jspec">JSpec</a> has been updated to version 3.  This version introduces several interesting updates (see the full <a href="http://github.com/visionmedia/jspec/blob/master/History.md">change list</a>):
<ul>
	<li>Rhino’s jar is included so console tests can work without installing extra stuff</li>
	<li>Added a <code>jspec stats</code> command</li>
	<li>Subcommand hooks — checks for spec/commands/*_command.rb</li>
	<li>Ruby server is now a Sinatra app</li>
</ul>
JSpec is now version 3.0 and currently has over 200 followers on GitHub, so it’s worth checking out.
<h3>Syntax Examples</h3>
JSpec tests can be written using a custom <span class="caps">DSL</span> or a grammar-less JavaScript syntax.  When using the <span class="caps">DSL</span> in browser-based tests, be sure to use <code>JSpec.exec()</code> to run tests rather than including the code in script tags (more details are in the <span class="caps">README</span>).

Tests written with the <span class="caps">DSL</span> look like this:
<div class="highlight">
<pre><span class="nx">describe</span> <span class="s1">'ShoppingCart'</span>
  <span class="nx">before_each</span>
    <span class="nx">cart</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ShoppingCart</span>
  <span class="nx">end</span>

  <span class="nx">describe</span> <span class="s1">'addProducts'</span>
    <span class="nx">it</span> <span class="s1">'should add several products'</span>
      <span class="nx">cart</span><span class="p">.</span><span class="nx">addProduct</span><span class="p">(</span><span class="s1">'cookie'</span><span class="p">)</span>
      <span class="nx">cart</span><span class="p">.</span><span class="nx">addProduct</span><span class="p">(</span><span class="s1">'icecream'</span><span class="p">)</span>
      <span class="nx">cart</span><span class="p">.</span><span class="nx">should</span><span class="p">.</span><span class="nx">have</span> <span class="mi">2</span><span class="o">,</span> <span class="s1">'products'</span>
    <span class="nx">end</span>
  <span class="nx">end</span>

  <span class="nx">describe</span> <span class="s1">'checkout'</span>
    <span class="nx">it</span> <span class="s1">'should throw an error when checking out with no products'</span>
      <span class="o">-</span><span class="p">{</span> <span class="nx">cart</span><span class="p">.</span><span class="nx">clear</span><span class="p">().</span><span class="nx">checkout</span><span class="p">()</span> <span class="p">}.</span><span class="nx">should</span><span class="p">.</span><span class="nx">throw_error</span> <span class="nx">EmptyCart</span>
    <span class="nx">end</span>
  <span class="nx">end</span>
<span class="nx">end</span></pre>
</div>
JavaScript equivalent:
<div class="highlight">
<pre><span class="nx">JSpec</span><span class="p">.</span><span class="nx">describe</span><span class="p">(</span><span class="s1">'ShoppingCart'</span><span class="o">,</span> <span class="kd">function</span><span class="p">(){</span>
  <span class="nx">before_each</span><span class="p">(</span><span class="kd">function</span><span class="p">{</span>
    <span class="nx">cart</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ShoppingCart</span>
  <span class="p">})</span>

  <span class="nx">describe</span><span class="p">(</span><span class="s1">'addProducts'</span><span class="o">,</span> <span class="kd">function</span><span class="p">(){</span>
    <span class="nx">it</span> <span class="p">(</span><span class="s1">'should add several products'</span><span class="o">,</span> <span class="kd">function</span><span class="p">(){</span>
      <span class="nx">cart</span><span class="p">.</span><span class="nx">addProducts</span><span class="p">(</span><span class="s1">'cookie'</span><span class="p">)</span>
      <span class="nx">cart</span><span class="p">.</span><span class="nx">addProducts</span><span class="p">(</span><span class="s1">'icecream'</span><span class="p">)</span>
      <span class="nx">expect</span><span class="p">(</span><span class="nx">cart</span><span class="p">).</span><span class="nx">to</span><span class="p">(</span><span class="nx">have</span><span class="o">,</span> <span class="mi">2</span><span class="o">,</span> <span class="s1">'products'</span><span class="p">)</span>
    <span class="p">})</span>
  <span class="p">})</span>

  <span class="nx">describe</span><span class="p">(</span><span class="s1">'checkout'</span><span class="o">,</span> <span class="kd">function</span><span class="p">(){</span>
    <span class="nx">it</span> <span class="p">(</span><span class="s1">'should throw an error when checking out with no products'</span><span class="o">,</span> <span class="kd">function</span><span class="p">(){</span>
      <span class="nx">expect</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span> <span class="nx">cart</span><span class="p">.</span><span class="nx">clear</span><span class="p">().</span><span class="nx">checkout</span><span class="p">()</span> <span class="p">}).</span><span class="nx">to</span><span class="p">(</span><span class="nx">throw_error</span><span class="o">,</span> <span class="nx">EmptyCart</span><span class="p">)</span>
    <span class="p">})</span>
  <span class="p">})</span>
<span class="p">})</span></pre>
</div>
<h3>Custom Matchers</h3>
Custom matchers can be defined using <code>JSpec.addMatchers</code>.  It’s possible to control the error messages.  It’s also possible to create sets of macros with similar names:
<div class="highlight">
<pre><span class="nx">JSpec</span><span class="p">.</span><span class="nx">addMatchers</span><span class="p">({</span>
  <span class="s1">'be disabled selected checked'</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">attr</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">return</span> <span class="s1">'jQuery(actual).attr("'</span> <span class="o">+</span> <span class="nx">attr</span> <span class="o">+</span> <span class="s1">'")'</span>
  <span class="p">}</span><span class="o">,</span>

  <span class="s1">'have type id title alt href src sel rev name target'</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">attr</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">return</span> <span class="kd">function</span><span class="p">(</span><span class="nx">actual</span><span class="o">,</span> <span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
      <span class="k">return</span> <span class="nx">value</span> <span class="o">?</span> <span class="nx">jQuery</span><span class="p">(</span><span class="nx">actual</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="nx">attr</span><span class="p">)</span> <span class="err">##</span> <span class="nx">value</span><span class="o">:</span>
                     <span class="nx">jQuery</span><span class="p">(</span><span class="nx">actual</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="nx">attr</span><span class="p">)</span>
    <span class="p">}</span>
  <span class="p">}</span>
<span class="p">})</span></pre>
</div>
<h3>Other Features</h3>
JSpec includes a command-line tool that can initialise project templates, as well as auto-testing when files are changed.  It can also work with Growl in Mac OS X.  It includes lots of familiar matchers and works well in a browser and console.
<h3>Installation</h3>
To try JSpec out, you can install it with <a href="http://docs.rubygems.org/">RubyGems</a> — <code>gem install jspec</code> and read the docs on <a href="http://github.com/visionmedia/jspec">github.com/visionmedia/jspec</a>.

The future telecommunication technology is video conference facilities   or <a href="http://www.eyenetwork.com/video-conference-solutions/">video conferencing solutions</a>. This communication facility allows several locations to interact with people  via audio and video simultaneously. <a href="http://www.mvision.co.uk/products/support-and-maintenance/">Video conference software</a> brings a cost effective video conferencing  system which is held over ISDN. This is very good video picture quality and  also much more reliable than the normal internet.
<div><a href="http://www.sportsbetting.com/">Online Betting</a></div>
<div>
<div><a href="http://sportsbetting.com/" target="_blank">SPORTSBETTING.COM</a> is the simplest and most popular destination  for sports betting on the Internet. Our many years of experience  guarantee you a  superior betting service. <a href="http://www.sportsbetting.com/join.html?WT.svl=j_r2c1id4" target="_blank">Join today</a> to take advantage of all our great  offers.</div>
</div>

<a href="http://www.intenseschool.com/boot_camp/microsoft/mcitp2008eaubcmp" alt="01.08.10">MCITP upgrade</a>Enroll to Intense School's highest rated MCITP Upgrade Boot Camp now. For more information, visit Intesneschool.com now!

<a href="http://www.ultrawebsitehosting.com/">LiteSpeed Hosting Provider</a>-LiteSpeed hosting with Ultra Website hosting .com. Increase the speed of your website with UltraWebsiteHosting.com’s LiteSpeed web services. Three times faster than Apache with the most competitive pricing. Live Support, price guarantee, 45-day money back guarantee… it’s tough to beat these guys!]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/jspec.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Benchmarks in JavaScript</title>
		<link>http://www.java-scriptgate.com/benchmarks-in-javascript.html</link>
		<comments>http://www.java-scriptgate.com/benchmarks-in-javascript.html#comments</comments>
		<pubDate>Mon, 04 Jan 2010 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2010/01/04/javascript-benchmarks</guid>
		<description><![CDATA[Speeding up page load times is a good way to decrease bounce rates and increase customer satisfaction.  And if you&#8217;re using JavaScript in your server-side architecture, speed will become increasingly important.  So you might be tempted to write y...]]></description>
			<content:encoded><![CDATA[Speeding up page load times is a good way to decrease bounce rates and increase customer satisfaction.  And if you’re using JavaScript in your server-side architecture, speed will become increasingly important.  So you might be tempted to write your own benchmarking code when puzzling over a tricky performance issue.  Fortunately there are quite a few JavaScript benchmarking libraries out there.
<h3>Unit Tests</h3>
If you’re writing <a href="http://dailyjs.com/2009/12/30/unit-testing/">unit tests</a> you should get some benchmark information.  Most libraries automatically benchmark tests — <a href="http://github.com/madrobby/scriptaculous/blob/master/src/unittest.js">unittest.js</a> includes a benchmark method.  You could use this outside of tests for some foresnic analysis.
<h3>JavaScript Benchmark</h3>
<a href="http://github.com/visionmedia/js-bm/">JavaScript Benchmark</a> is a nice little library that features:
<ul>
	<li><span class="caps">ASCII</span>-friendly output that’s great for server-side JavaScript</li>
	<li>A simple <span class="caps">API</span></li>
	<li>Test suite support</li>
</ul>
Each benchmark will be run once by default, or you can specify a value:
<div class="highlight">
<pre><span class="nx">suite</span><span class="p">(</span><span class="s1">'Iteration'</span><span class="o">,</span> <span class="mi">50000</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
  <span class="nx">array</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="o">,</span><span class="mi">2</span><span class="o">,</span><span class="mi">3</span><span class="o">,</span><span class="mi">4</span><span class="o">,</span><span class="mi">5</span><span class="o">,</span><span class="mi">6</span><span class="o">,</span><span class="mi">7</span><span class="o">,</span><span class="mi">8</span><span class="o">,</span><span class="mi">9</span><span class="p">];</span>

  <span class="nx">benchmark</span><span class="p">(</span><span class="s1">'for'</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">array</span><span class="p">.</span><span class="nx">length</span><span class="o">;</span> <span class="o">++</span><span class="nx">i</span><span class="p">);</span>
  <span class="p">});</span>

  <span class="nx">benchmark</span><span class="p">(</span><span class="s1">'for cached'</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">,</span> <span class="nx">len</span> <span class="o">=</span> <span class="nx">array</span><span class="p">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="o">;</span> <span class="o">++</span><span class="nx">i</span><span class="p">);</span>
  <span class="p">});</span>

  <span class="nx">benchmark</span><span class="p">(</span><span class="s1">'for in'</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">array</span><span class="p">);</span>
  <span class="p">});</span>
<span class="p">});</span></pre>
</div>
This library won’t work in a browser due to the use of the <code>print()</code> function, but all you need to do is supply your own.  Something like this will do:
<div class="highlight">
<pre><span class="kd">function</span> <span class="nx">print</span><span class="p">(</span><span class="nx">message</span><span class="p">)</span> <span class="p">{</span>
  <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'log'</span><span class="p">).</span><span class="nx">innerHTML</span> <span class="o">+=</span> <span class="nx">message</span> <span class="o">+</span> <span class="s2">"\n"</span><span class="o">;</span>
<span class="p">}</span></pre>
</div>
I’ve put a full example up here: <a href="http://dailyjs.com/files/benchmarks.html">benchmarks.html</a>
<h3>BenchmarkBuddy</h3>
<a href="http://github.com/unwiredbrain/BenchmarkBuddy/">BenchmarkBuddy</a> is inspired by the <code>RunSingleBenchmark</code> from the V8 source.  Here’s one of the author’s examples:
<div class="highlight">
<pre><span class="nx">alert</span><span class="p">(</span><span class="nx">BenchmarkBuddy</span><span class="p">.</span><span class="nx">run</span><span class="p">(</span><span class="nb">Math</span><span class="p">.</span><span class="nx">random</span><span class="p">));</span></pre>
</div>
<h3>Benchmark.js</h3>
<a href="http://github.com/mnoble/Benchmark.js/">Benchmark.js</a> is based on Ruby’s benchmark library.  It’s still a work in progress and isn’t currently console-friendly, but when it works it will look like this:
<div class="highlight">
<pre><span class="nx">Benchmark</span><span class="p">.</span><span class="nx">benchmark</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
  <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="mi">10000000</span><span class="o">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span> <span class="p">}</span>
<span class="p">});</span></pre>
<pre><span class="p">
</span></pre>
<pre><span class="p"><a href="http://www.forumlinkbuilding.com/view/link_building_services" target="_blank">link building services</a> </span></pre>
<pre><span class="p"><a href="http://www.sdltridion.com/" target="_blank">web content management</a></span></pre>
<pre><span class="p">
</span></pre>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/benchmarks-in-javascript.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2010 New Year’s Resolution</title>
		<link>http://www.java-scriptgate.com/2010-new-years-resolution.html</link>
		<comments>http://www.java-scriptgate.com/2010-new-years-resolution.html#comments</comments>
		<pubDate>Thu, 31 Dec 2009 07:31:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://blog.echo-flow.com/2009/12/31/2010-new-years-resolution/</guid>
		<description><![CDATA[I have a backlog of draft posts, and I&#8217;m going to start working my way through them. I had a very interesting semester, and the next should be even more interesting. I&#8217;m keen to resume sharing. Look for more posts to come.
]]></description>
			<content:encoded><![CDATA[<p>I have a backlog of draft posts, and I&#8217;m going to start working my way through them. I had a very interesting semester, and the next should be even more interesting. I&#8217;m keen to resume sharing. Look for more posts to come.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/2010-new-years-resolution.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Unit Testing</title>
		<link>http://www.java-scriptgate.com/javascript-unit-testing.html</link>
		<comments>http://www.java-scriptgate.com/javascript-unit-testing.html#comments</comments>
		<pubDate>Wed, 30 Dec 2009 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2009/12/30/unit-testing</guid>
		<description><![CDATA[Our JavaScript Developer Survey results showed that a large percentage of readers don&#8217;t currently unit test their JavaScript.  I&#8217;ve been unit testing my own JavaScript projects for a few years, which resulted in the creation of riotjs &#821...]]></description>
			<content:encoded><![CDATA[<p>Our <a href="http://dailyjs.com/2009/12/02/survey-results/">JavaScript Developer Survey results</a> showed that a large percentage of readers don&#8217;t currently unit test their JavaScript.  I&#8217;ve been unit testing my own JavaScript projects for a few years, which resulted in the creation of <a href="http://gist.github.com/alexyoung/riotjs">riotjs</a> &#8212; for more on riotjs see my blog post: <a href="http://alexyoung.org/2009/11/04/riotjs/">Riotjs: A JavaScript Unit Testing Framework</a></p>
<p>There are lots of JavaScript test frameworks.  I&#8217;ve presented a summary below &#8212; there are both traditional unit testing libraries and behaviour-driven frameworks.</p>
<h3>unittest.js</h3>
<p><a href="http://github.com/madrobby/scriptaculous/blob/master/src/unittest.js">unittest.js</a> by Thomas Fuchs has been used by many JavaScript developers since <a href="http://script.aculo.us/">Scriptaculous</a> became popular in 2006.  It provides a test framework that is recognisable to Ruby developers, and the relationship between Rails and Scriptaculous further increased adoption in this group.</p>
<p>This library depends on <a href="http://prototypejs.org/">Prototype</a> and is usually run inside <span class="caps">HTML</span> templates rather than a JavaScript interpreter.</p>
<p>Tests look like this:</p>
<div class="highlight"><pre>  <span class="k">new</span> <span class="nx">Test</span><span class="p">.</span><span class="nx">Unit</span><span class="p">.</span><span class="nx">Runner</span><span class="p">({</span>
    <span class="nx">testExample</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="kd">with</span><span class="p">(</span><span class="k">this</span><span class="p">)</span> <span class="p">{</span>
      <span class="kd">var</span> <span class="nx">exampleVar</span> <span class="o">=</span> <span class="s1">&#39;1234&#39;</span><span class="o">;</span>
      <span class="nx">assertEqual</span><span class="p">(</span><span class="s1">&#39;1234&#39;</span><span class="o">,</span> <span class="nx">exampleVar</span><span class="p">);</span>
      <span class="nx">assert</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
    <span class="p">}}</span>
    
  <span class="p">}</span><span class="o">,</span> <span class="s2">&quot;testlog&quot;</span><span class="p">);</span>
</pre>
</div><p>Fuchs uses <code>with(this)</code> to cut down unnecessary syntax &#8212; you don&#8217;t have to write tests this way though.</p>
<p>Setup and teardown methods are supported.  Shoulda-style assertion names have also been added.  This adds methods to the prototypes for common JavaScript objects, so it&#8217;s possible to write <code>'test'.shouldEqual('test')</code>.</p>
<p>unittest.js also includes a handy <code>benchmark</code> method, and the following assertions:</p>
<table>
	<tr>
		<td> <code>assertNotEqual(expected, actual)</code> </td>
		<td> Inverse of <code>assertEqual</code> </td>
	</tr>
	<tr>
		<td> <code>assertNotVisible(element)</code> </td>
		<td> Checks if an element has display: none </td>
	</tr>
	<tr>
		<td> <code>assertVisible(element)</code> </td>
		<td> Inverse of above </td>
	</tr>
	<tr>
		<td> <code>assertInspect(expected, actual)</code> </td>
		<td> Checks if <code>expected</code> is the same as <code>actual.inspect()</code> </td>
	</tr>
	<tr>
		<td> <code>assertEnumEqual(expected, actual)</code> </td>
		<td> Ensured two enumerables are equal </td>
	</tr>
	<tr>
		<td> <code>assertIdentical(expected, actual)</code> </td>
		<td> Comparison using <code>===</code> </td>
	</tr>
	<tr>
		<td> <code>assertNotIdentical(expected, actual)</code> </td>
		<td> Inverse of above </td>
	</tr>
	<tr>
		<td> <code>assertNull(obj)</code> </td>
		<td> Is <code>obj</code> null? </td>
	</tr>
	<tr>
		<td> <code>assertNotNull(obj)</code> </td>
		<td> Inverse of above </td>
	</tr>
	<tr>
		<td> <code>assertMatch(expected, actual) </td>
		<td> Performs a regex, where <code>expected</code> is the regex </td>
	</tr>
	<tr>
		<td> <code>assertType(expected, actual) </td>
		<td> Checks if <code>actual.constructor == expected</code> </td>
	</tr>
	<tr>
		<td> <code>assertNotOfType(expected, actual)</code> </td>
		<td> Inverse of above </td>
	</tr>
	<tr>
		<td> <code>assertInstanceOf(expected, actual)</code> </td>
		<td> Checks if <code>actual</code> is <code>instanceof</code> <code>expected</code> </td>
	</tr>
	<tr>
		<td> <code>assertNotInstanceOf(expected, actual)</code> </td>
		<td> Inverse of above </td>
	</tr>
	<tr>
		<td> <code>assertRespondsTo(method, obj)</code> </td>
		<td> Checks if <code>obj</code> has a method named <code>method</code> </td>
	</tr>
	<tr>
		<td> <code>assertReturnsTrue(method, obj)</code> </td>
		<td> Ensured that the method named <code>method</code> called on <code>obj</code> returns true </td>
	</tr>
	<tr>
		<td> <code>assertReturnsFalse</code> </td>
		<td> Inverse of above </td>
	</tr>
	<tr>
		<td> <code>assertRaise(exceptionName, method)</code> </td>
		<td> Ensures calling <code>method</code> raises an exception named <code>exceptionName</code> </td>
	</tr>
	<tr>
		<td> <code>assertElementsMatch([elements], expression1, expression2, ...) </td>
		<td> Ensures the array of elements match the list of expressions </td>
	</tr>
	<tr>
		<td> <code>assertElementMatches(element, expression) </td>
		<td> A helper for the above assertion when supplying a single element </td>
	</tr>
</table>
<h3>JsUnitTest</h3>
<p><a href="http://github.com/drnic/jsunittest/">JsUnitTest</a> is a port of unittest.js without the Prototype dependency.</p>
<h3>JsUnit</h3>
<p>Development for <a href="http://www.jsunit.net/">JsUnit</a>  started in 2001, and is based on JUnit.  Like unittest.js, tests are designed to be run in a web browser.  By using the <code>build.xml</code> Ant file, tests can be run against multiple browsers on a local machine, or on multiple remote machines.</p>
<p>JsUnit tests are grouped within a <em>Test Page</em>.  Test pages contain your tests.  If a Test Page has <code>setUp</code> or <code>tearDown</code> functions, they will be run before and after each test function.  A function called <code>setUpPage</code> will be run once per Test Page.</p>
<p>Each test function is written prefixed with <code>test</code>:</p>
<div class="highlight"><pre><span class="kd">function</span> <span class="nx">testExample</span><span class="p">()</span> <span class="p">{</span>
    <span class="nx">assert</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
<span class="p">}</span>
</pre>
</div><p>The following assertions are available:</p>
<ul>
	<li><code>assert([comment], booleanValue)</code></li>
	<li><code>assertTrue([comment], booleanValue)</code></li>
	<li><code>assertFalse([comment], booleanValue)</code></li>
	<li><code>assertEquals([comment], value1, value2)</code></li>
	<li><code>assertNotEquals([comment], value1, value2)</code></li>
	<li><code>assertNull([comment], value)</code></li>
	<li><code>assertNotNull([comment], value)</code></li>
	<li><code>assertUndefined([comment], value)</code></li>
	<li><code>assertNotUndefined([comment], value)</code></li>
	<li><code>assertNaN([comment], value)</code></li>
	<li><code>assertNotNaN([comment], value)</code></li>
	<li><code>fail(comment)</code></li>
</ul>
<h3>QUnit</h3>
<p><a href="http://github.com/jquery/qunit/">QUnit</a> is used by jQuery for its unit tests.  To use QUnit, include qunit.js and qunit.css within a <span class="caps">HTML</span> file that can display the test results.</p>
<p>Tests look like this:</p>
<div class="highlight"><pre><span class="nx">test</span><span class="p">(</span><span class="s2">&quot;a basic test example&quot;</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
  <span class="nx">ok</span><span class="p">(</span><span class="kc">true</span><span class="o">,</span> <span class="s2">&quot;this test is fine&quot;</span><span class="p">);</span>
  <span class="kd">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="s2">&quot;hello&quot;</span><span class="o">;</span>
  <span class="nx">equals</span><span class="p">(</span><span class="s2">&quot;hello&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">,</span> <span class="s2">&quot;We expect value to be hello&quot;</span><span class="p">);</span>
<span class="p">});</span>
</pre>
</div><p>The <a href="http://docs.jquery.com/QUnit">jQuery QUnit</a> documentation has full examples.</p>
<h3>jspec</h3>
<p><a href="http://github.com/wycats/jspec/">jspec</a> (by Yehuda Katz) is an <a href="http://rspec.info/">RSpec</a> inspired framework.  Rather than traditional unit tests, jspec attempts to provide a behaviour-driven development approach.</p>
<p>This is best illustrated with an example:</p>
<div class="highlight"><pre><span class="nx">jspec</span><span class="p">.</span><span class="nx">describe</span><span class="p">(</span><span class="s2">&quot;The browser environment&quot;</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
  <span class="nx">it</span><span class="p">(</span><span class="s2">&quot;should have Array.prototype.push&quot;</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="nb">Array</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">push</span><span class="p">.</span><span class="nx">should</span><span class="p">(</span><span class="s2">&quot;exist&quot;</span><span class="p">);</span>
  <span class="p">});</span>
 
  <span class="nx">it</span><span class="p">(</span><span class="s2">&quot;should have Function.prototype.apply&quot;</span><span class="o">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="nb">Function</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">apply</span><span class="p">.</span><span class="nx">should</span><span class="p">(</span><span class="s2">&quot;exist&quot;</span><span class="p">);</span>
  <span class="p">});</span>
<span class="p">})</span>
</pre>
</div><p>Tests are written with <code>it()</code> blocks and chained <code>should()</code> calls.</p>
<p>The GitHub repository is currently pretty spartan, with no documentation or <span class="caps">README</span>, but jspec is a good port for those of you who are familiar with RSpec or want a change from JUnit-style libraries.</p>
<h3>JSpec</h3>
<p><a href="http://github.com/visionmedia/jspec">JSpec</a> by visionmedia (who have cropped up frequently on DailyJS) is a much more fleshed out <span class="caps">BDD</span> library.  The author has tried to keep it minimal, but it has a unique and friendly <span class="caps">DSL</span>.  It&#8217;s possible to write &#8220;grammar-less&#8221; tests using plain JavaScript.</p>
<h3>Jasmine</h3>
<p><a href="http://github.com/pivotal/jasmine/">Jasmine</a> builds on the ideas of the previous libraries to provide a <span class="caps">BDD</span> library that supports asynchronous tests &#8212; Ajax-friendly testing.</p>]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/javascript-unit-testing.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doodle.js</title>
		<link>http://www.java-scriptgate.com/doodle-js.html</link>
		<comments>http://www.java-scriptgate.com/doodle-js.html#comments</comments>
		<pubDate>Tue, 29 Dec 2009 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2009/12/29/doodle</guid>
		<description><![CDATA[
I&#8217;ve written a few posts about canvas-based animation and graphics libraries lately.  Before moving on to another topic I thought I&#8217;d mention Doodle.js, which is a sprite-based canvas library.  Doodle.js simplifies working with the canvas,...]]></description>
			<content:encoded><![CDATA[<p><img src="http://dailyjs.com/images/posts/heart01.jpg" alt="" /></p>
<p>I&#8217;ve written a few posts about canvas-based animation and graphics libraries lately.  Before moving on to another topic I thought I&#8217;d mention <a href="http://github.com/biilly/doodle.js">Doodle.js</a>, which is a sprite-based canvas library.  Doodle.js simplifies working with the canvas, and includes <a href="http://code.google.com/p/explorercanvas/">excanvas</a> for IE support.</p>
<p>Code using Doodle.js looks like this:</p>
<div class="highlight"><pre><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">oo</span><span class="p">)</span> <span class="p">{</span>
 <span class="nx">oo</span><span class="p">.</span><span class="nx">canvas</span><span class="p">(</span><span class="s1">&#39;#my_canvas&#39;</span><span class="p">);</span>
 <span class="kd">var</span> <span class="nx">box</span> <span class="o">=</span> <span class="nx">oo</span><span class="p">.</span><span class="nx">rect</span><span class="p">({</span><span class="nx">x</span><span class="o">:</span><span class="mi">25</span><span class="o">,</span> <span class="nx">y</span><span class="o">:</span><span class="mi">25</span><span class="o">,</span>
                    <span class="nx">width</span><span class="o">:</span><span class="mi">50</span><span class="o">,</span> <span class="nx">height</span><span class="o">:</span><span class="mi">50</span><span class="o">,</span> <span class="nx">fill</span><span class="o">:</span><span class="s2">&quot;#ff0000&quot;</span><span class="p">});</span>
 <span class="nx">box</span><span class="p">.</span><span class="nx">draw</span><span class="p">();</span> <span class="c">//draw a red box with initial parameters</span>
 
 <span class="nx">box</span><span class="p">.</span><span class="nx">modify</span><span class="p">({</span><span class="nx">fill</span><span class="o">:</span><span class="s1">&#39;rgb(0,255,0)&#39;</span><span class="p">}).</span><span class="nx">translate</span><span class="p">(</span><span class="mi">50</span><span class="o">,</span><span class="mi">0</span><span class="p">).</span><span class="nx">draw</span><span class="p">();</span>
 <span class="nx">box</span><span class="p">.</span><span class="nx">modify</span><span class="p">({</span><span class="nx">fill</span><span class="o">:</span><span class="s1">&#39;purple&#39;</span><span class="p">}).</span><span class="nx">rotate</span><span class="p">(</span><span class="o">-</span><span class="mi">45</span><span class="p">).</span><span class="nx">draw</span><span class="p">();</span>
 <span class="nx">box</span><span class="p">.</span><span class="nx">modify</span><span class="p">({</span><span class="nx">fill</span><span class="o">:</span><span class="s1">&#39;yellow&#39;</span><span class="p">}).</span><span class="nx">translate</span><span class="p">(</span><span class="mi">50</span><span class="o">,</span><span class="mi">0</span><span class="p">).</span><span class="nx">scale</span><span class="p">(</span><span class="mf">1.5</span><span class="p">).</span><span class="nx">draw</span><span class="p">();</span>
 <span class="nx">box</span><span class="p">.</span><span class="nx">modify</span><span class="p">({</span><span class="nx">fill</span><span class="o">:</span><span class="s1">&#39;blue&#39;</span><span class="p">}).</span><span class="nx">transform</span><span class="p">(</span><span class="mf">1.5</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mi">0</span><span class="o">,</span><span class="mf">1.5</span><span class="o">,</span><span class="mi">50</span><span class="o">,</span><span class="mi">0</span><span class="p">).</span><span class="nx">draw</span><span class="p">();</span>
 
<span class="p">})(</span><span class="nx">$doodle</span><span class="p">);</span>
</pre>
</div><p>As you can see, the <span class="caps">API</span> is fairly clean.  There isn&#8217;t currently much documentation, but the author has written a <a href="http://www.lamberta.org/blog/doodle/">length blog post</a> with examples.</p>
<p>While <a href="http://processingjs.org/">Processing.js</a> is a full drawing and animation system, and <a href="http://raphaeljs.com/">Raphael</a> is a vector graphics library, Doodle.js provides a simple way of working with sprites.</p>]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/doodle-js.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WTFramework – Detect Which Framework A Site Is Using, The Easy Way</title>
		<link>http://www.java-scriptgate.com/wtframework-%e2%80%93-detect-which-framework-a-site-is-using-the-easy-way.html</link>
		<comments>http://www.java-scriptgate.com/wtframework-%e2%80%93-detect-which-framework-a-site-is-using-the-easy-way.html#comments</comments>
		<pubDate>Sun, 27 Dec 2009 20:20:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://thejavascriptblog.com/?p=71</guid>
		<description><![CDATA[WTFramework Summary
WTFramework is a dead simple, and well designed way to detect which framework a site is using as well as version. Being primarily a JavaScript developer I was always looking through the source to find which framework a certain site was using. Or to see if the developer had done something particularly cool with [...]]]></description>
			<content:encoded><![CDATA[<h2>WTFramework Summary</h2>
WTFramework is a dead simple, and well designed way to detect which framework a site is using as well as version. Being primarily a JavaScript developer I was always looking through the source to find which framework a certain site was using. Or to see if the developer had done something particularly cool with my favorite framework <a href="http://mootools.net">MooTools</a>.

It was developed by <a href="http://twitter.com/oskar">Oskar Krawczyk</a> and is implemented as a bookmark for any A grade browser. You simply drag it into your bookmarks bar and its installed. You can now use it on any site you visit. The notifications are “Growl” like and are very well designed.

Kudos to Oskar on this one, a dead simple, but time saving tool.
<h2>Installation</h2>
<ol>
	<li><a href="http://nouincolor.com/wtframework/2.0/">Visit The Site</a></li>
	<li>Drag the big red icon into your bookmarks.</li>
	<li>It is now installed.</li>
</ol>
<h2>Fortunately For Us</h2>
Oskar has a public Git Hub repository for this. So if needs be you can change it to suit your needs.
<h2>Gallery</h2>
<a title="Screen shot 2009-12-29 at 7.15.25 PM" href="http://thejavascriptblog.com/wtframework-detect-which-framework-a-site-is-using-the-easy-way/screen-shot-2009-12-29-at-7-15-25-pm/"><img class="attachment-thumbnail" title="Screen shot 2009-12-29 at 7.15.25 PM" src="http://thejavascriptblog.com/wp-content/uploads/2009/12/Screen-shot-2009-12-29-at-7.15.25-PM-150x150.png" alt="" width="150" height="150" /></a>
<a title="Screen shot 2009-12-29 at 7.16.01 PM" href="http://thejavascriptblog.com/wtframework-detect-which-framework-a-site-is-using-the-easy-way/screen-shot-2009-12-29-at-7-16-01-pm/"><img class="attachment-thumbnail" title="Screen shot 2009-12-29 at 7.16.01 PM" src="http://thejavascriptblog.com/wp-content/uploads/2009/12/Screen-shot-2009-12-29-at-7.16.01-PM-150x150.png" alt="" width="150" height="150" /></a>

London based Website Design Company is providing professional website design and <a href="http://www.obs-group.co.uk/website-development"> website development services</a>. They create a range of website applications and solutions - from secure ecommerce platforms to tailored content management system. Hampshire based Web design agency is specializing in <a href="http://www.mustard-design.co.uk/ecommerce-web-development">ecommerce website development</a>. Browse through our work portfolio on website designing. Our programming team focuses to deliver an ecommerce web design that produces great ROI.]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/wtframework-%e2%80%93-detect-which-framework-a-site-is-using-the-easy-way.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conway&#8217;s Game of Life</title>
		<link>http://www.java-scriptgate.com/conways-game-of-life.html</link>
		<comments>http://www.java-scriptgate.com/conways-game-of-life.html#comments</comments>
		<pubDate>Wed, 23 Dec 2009 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2009/12/23/conway</guid>
		<description><![CDATA[
Our recent post about Processing.js made me think about Conway&#8217;s Game of Life.  If you haven&#8217;t come across it before, it&#8217;s a simulation that works like this:

1. Any live cell with fewer than two live neighbours dies, as if caused by...]]></description>
			<content:encoded><![CDATA[<p><img src="http://dailyjs.com/images/posts/conway.png" alt="" /></p>
<p>Our recent post about <a href="http://processingjs.org/">Processing.js</a> made me think about <a href="http://en.wikipedia.org/wiki/Conway%27s_game_of_life">Conway&#8217;s Game of Life</a>.  If you haven&#8217;t come across it before, it&#8217;s a simulation that works like this:</p>
<blockquote>
<p>1. Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.<br />
   2. Any live cell with more than three live neighbours dies, as if by overcrowding.<br />
   3. Any live cell with two or three live neighbours lives on to the next generation.<br />
   4. Any dead cell with exactly three live neighbours becomes a live cell.</p>
</blockquote>
<p>I like to use this algorithm to experiment with new graphics libraries, so I had my own Processing version from back in 2005.  I&#8217;ve ported it to Processing.js here <a href="http://github.com/alexyoung/conway-js">conway-js</a>.</p>
<p>I&#8217;ve also found lots of interesting pure JavaScript implementations.  <a href="http://github.com/joeyrobert/ConwayJS/">ConwayJS</a> by Joseph Robert is my favourite.  It&#8217;s pretty fast and allows you to draw cells with the mouse.</p>
<p>Another interesting one is <a href="http://github.com/sukhchander/game_of_life/">game_of_life</a> by <a href="http://sukhchander.com/">sukhchander</a>.</p>
<p>I&#8217;ve uploaded my Processing.js examples to DailyJS so you can see them without checking out the git repositories:</p>
<ul>
	<li><a href="http://dailyjs.com/files/firejs/">fire.js</a></li>
	<li><a href="http://dailyjs.com/files/conway-js/">conway-js</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/conways-game-of-life.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Particle System</title>
		<link>http://www.java-scriptgate.com/javascript-particle-system.html</link>
		<comments>http://www.java-scriptgate.com/javascript-particle-system.html#comments</comments>
		<pubDate>Tue, 22 Dec 2009 00:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS and App]]></category>

		<guid isPermaLink="false">http://dailyjs.com/2009/12/22/particle-system</guid>
		<description><![CDATA[After yesterday&#8217;s Processing.js article I discovered this post about creating a particle system with JavaScript and a canvas: Parcycle: A Particle System with HTML5 canvas.
You can view the effect in action in this demo: Parcycle

I found the use...]]></description>
			<content:encoded><![CDATA[<p>After <a href="http://dailyjs.com/2009/12/21/processingjs/">yesterday&#8217;s Processing.js article</a> I discovered this post about creating a particle system with JavaScript and a canvas: <a href="http://www.mrspeaker.net/2009/12/03/particle-system-with-html5-canvas/">Parcycle: A Particle System with HTML5 canvas</a>.</p>
<p>You can view the effect in action in this demo: <a href="http://www.mrspeaker.net/dev/parcycle/">Parcycle</a></p>
<p><img src="http://dailyjs.com/images/posts/parcycle.png" alt="" /></p>
<p>I found the use of <a href="https://developer.mozilla.org/samples/canvas-tutorial/6_1_canvas_composite.html">globalCompositeOperation</a> very interesting in this code.  It allowed the author to make particles appear lighter when they overlap by using a drawing mode rather than detecting the colour on the canvas.</p>]]></content:encoded>
			<wfw:commentRss>http://www.java-scriptgate.com/javascript-particle-system.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
