Hoopty

Copyright (c) 2007 by Brian Ecker

Hoopty is an AJAX-like external JavaScript loader with the much more 'sane' security policy requiring only that URL match document.domain.

Description

The common AJAX loader functions XMLHttpRequest and Microsoft.XMLHTTP are too restrictive (IMHO) in their security rules. They require the whole hostname of your external source URL to match (chapter and verse) the hostname of your current page. Hoopty only requires you to match document.domain, which you can set to be as least restrictive as foo.com.

API

Hoopty is very simple to use (you may have noticed that across all my tools). It consists of a single function:

loadJavaScript(url, callback)

where:

url is the external JavaScript you want to load

callback (optional) is the function you want hoopty to call once the JavaScript has loaded

License

Hoopty is licensed under the terms of the BSD license.

Download

You can download v1.0 of Hoopty here: hoopty.js