Drawing nice shapes with JavaScript

Monday, July 7th, 2008

It is amazing what you can do with JavaScript:

http://azarask.in/blog/post/contextfreejs-algorithm-ink-making-art-with-javascript/

Prototype 1.6 changes to inserting elements

Wednesday, June 25th, 2008

The Insertion object has been deprecated, so when you used to do this:


new Insertion.After($('element'), '<p>jibble</p>');

You now do:

$("items").insert({ after: new Element("p") });
$("items").insert({ top: "<li>an item</li>" });
$("items").insert("<li>another item</li>"); // defaults to bottom

See here for more info:
http://www.prototypejs.org/2007/8/15/prototype-1-6-0-release-candidate

debugging IE - var dump for javascript - sometime it is just needed with IE!

Monday, June 2nd, 2008

for (var member in object) {
alert(’Name: ‘ + member);
alert(’Value: ‘ + object[member]);
}

Selenium test suite

Wednesday, May 21st, 2008

I need to perform many tests in one go one a few of my sites - so setting up a test suite with selenium

http://www.jamesnetherton.com/blog/index.cfm/2007/7/2/Creating-a-Selenium-test-suite

doing lots of AJAX? need some loading icons?

Thursday, May 15th, 2008

http://www.ajaxload.info/

Debugging JavaScript using Firefox plugin JavaScipt plugin by Venkman

Tuesday, May 13th, 2008

The Firefox plugin JavaScipt plugin by Venkman; yet another tool to learn - this was useful:

http://svendtofte.com/code/learning_venkman/venkmanwindows.php

AJAX request dies if you don’t escape the values

Wednesday, May 7th, 2008

Yes yes as expected I know. If you are passing name value pairs such as jibble=bibblebobble and yo uwant multiple values such as jibble=bibblebobble&amp;flibble=nibblenobbol you don;t want the first value to have an ‘&’ in it so use the JavaScript function escape().

Simple I know but an easy one to miss! Hooray for testers!

Prototype an IE bug! error code 1223

Wednesday, May 7th, 2008

Once again IE is being a pain. I am using prototype and making an ajax request. The response is just some JSON in the headers but no content. This is fine in Firefox but not so in IE. In IE it raises the onFailure event and gives the status of 1223.

It turns out that IE cannot handle blank content sent back from an AJAX request. Simple solution was to just give it some content back too!

This bug from dojo was useful:

http://trac.dojotoolkit.org/ticket/2418

This is technically an IE bug, but since it’s extremely unlikely that the agile giant will actually fix it I’m posting it here.

Sometimes IE translates HTTP 204 (No Content) into its own internal Status Code 1223. This causes BrowserIO to indicate an error condition in the response.

Status Code 1223 appears to be related to user-cancellation of requests. It appears on MSDN related to canceled Shutdown requests.

Firebug for IE

Thursday, May 1st, 2008

http://remysharp.com/2007/03/13/firebug-in-ie-for-any-web-site/

JavaScript testing

Wednesday, April 2nd, 2008

http://jania.pe.kr/aw/moin.cgi/JSSpec