<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>JavaScript on Squid's Blog</title><link>https://gigasquidsoftware.com/categories/javascript/</link><description>Recent content in JavaScript on Squid's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 05 May 2011 16:42:13 +0000</lastBuildDate><atom:link href="https://gigasquidsoftware.com/categories/javascript/atom.xml" rel="self" type="application/rss+xml"/><item><title>Mocking Ajax Calls with Jasmine</title><link>https://gigasquidsoftware.com/blog/2011/05/05/mocking-ajax-calls-with-jasmine/</link><pubDate>Thu, 05 May 2011 16:42:13 +0000</pubDate><guid>https://gigasquidsoftware.com/blog/2011/05/05/mocking-ajax-calls-with-jasmine/</guid><description>&lt;p&gt;I have been happily using &lt;a href="https://github.com/pivotal/jasmine/"&gt;Jasmine&lt;/a&gt; and &lt;a href="https://github.com/velesin/jasmine-jquery"&gt;Jasmine-JQuery&lt;/a&gt; on a project with great success. However, I was still unsure about how to handle mocking the ajax calls back to the server. It turns out the answer is already in Jasmine. Time to call out the spies!&lt;/p&gt;
&lt;p&gt;There is a wiki page on spies &lt;a href="https://github.com/pivotal/jasmine/wiki/Spies"&gt;https://github.com/pivotal/jasmine/wiki/Spies&lt;/a&gt;, but I always enjoy a nice code sample.&lt;/p&gt;
&lt;p&gt;In my source file I have an ajax call that I would like to mock that looks like this:
[gist id=957387]&lt;/p&gt;</description></item><item><title>Hacking JavaScript for the Love of Clojure</title><link>https://gigasquidsoftware.com/blog/2011/05/01/hacking-javascript-for-the-love-of-clojure/</link><pubDate>Sun, 01 May 2011 14:02:39 +0000</pubDate><guid>https://gigasquidsoftware.com/blog/2011/05/01/hacking-javascript-for-the-love-of-clojure/</guid><description>&lt;p&gt;Lately, I have been working on the awesome open source project &lt;a href="http://www.4clojure.com/"&gt;4Clojure.com&lt;/a&gt;. The site helps you to learn Clojure by solving “koan” type problems in an interactive format. One of the enhancements that I was looking at putting in was a way to enter code in a text box and have it color highlight as type. I found the &lt;a href="http://ace.ajax.org/"&gt;ACE project&lt;/a&gt;, which looked like exactly what I wanted. However, sad panda, they didn&amp;rsquo;t have a Clojure mode. Not deterred, I decided that I would try to take a crack at it. I ported most of the rules from the Clojure brush in Syntax Highlighter over and implemented some basic auto-indent.&lt;/p&gt;</description></item></channel></rss>