Hi folks,
I think theres a typo / bug in the init function
var Scriptaculous = {
Version: '1.8.3',
require: function(libraryName) {
try{
// inserting via DOM fails in Safari 2.0, so brute force approach
document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
} catch(e) {
// for xhtml+xml served content, fall back to DOM methods
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = libraryName;
document.getElementsByTagName('head')[0].appendChild(script);
}
}
Shouldn't try and catch be otherwise?
IMHO it will be "brute forced" for every browser that accepts document.write.
Shouldn't first be tried to append it via DOM and only in case of error be bruteforced?
Hope I'm not to dumb to understand this right ;-)
Greets
Fränzchen
Nah, there's no error raised in Safari 2 for this, and document.write works in all browsers. The catch is there so if there's no document.write support (xhtml+xml served pages), the normal DOM operations are used.
Thx 4 ur fast answer ... obviously theres much too learn for me.
Sorry 4 annoying.
Greets Fränzchen