I want to create a simple bit of JS code that creates an image element in the background and doesn\'t display anything. The image element will call a tracking URL (such as
Are you allowed to use a framework? jQuery and Prototype make this sort of thing pretty easy. Here's a sample in Prototype:
var elem = new Element('img', { 'class': 'foo', src: 'pic.jpg', alt: 'alternate text' }); $(document).insert(elem);