fiddle2 entry

< previous [home] next >

Date: 2007-10-02 11:31:50 (Author: trav)
Link: http://travis.kroh.net/archives/004969.php

Recently, I started serving fiddle2 with a content type of application/xml+xhtml (like you're supposed to), but that apparently broke script.aculo.us (which is what I use to expand the archives link list). Whenever I'd load script.aculo.us, Firefox would throw an exception:

Error: uncaught exception: [Exception... "Object cannot be created in this context" code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)" location: "http://kroh.net/js/scriptaculous.js Line: 30"]

A little searching turned up a page that suggests replacing lines 28-31 of scriptaculous.js require: function(libraryName) { // inserting via DOM fails in Safari 2.0, so brute force approach document.write('<script type="text/javascript" src="'+libraryName+'"></script>'); }, with a block that handles the exception and includes the script via the DOM: require: function(libraryName) { try { script_tag = document.createElement('script'); script_tag.type = 'text/javascript'; script_tag.src = libraryName; head = document.getElementsByTagName("head")[0]; head.appendChild(script_tag); } catch(e) { // inserting via DOM fails in Safari 2.0, so brute force approach document.write('<script type="text/javascript" src="'+libraryName+'"></script>'); } } Now I have to find out why Google's ad script throws it. Working around that should be lots of fun.
Update: Indeed it was. I had to re-write part of the included Javascript.

 

[ home - archives - quoteboard - blogger decoder - wishlist ]

Creative Commons License This work is licensed under a Creative Commons License.