[jQuery] Two IE6/7 issues: clone() & creating DOM element
I'm having 2 little issues regarding IE6/7 with 2 instructions that
seem to work just fine in most browsers but not in IE6/7.
First one, using clone() method:
$('div#content a').each(function(elem) {
if(elem === 0) {
var color = $(this).clone(false).addClass('content-
link').css('color');
}
}
Second one, creating a DOM element:
$('<script type="text/javascript" src="' + scriptsPath +
scriptFiles[idx] + '.js"></script>)').appendTo("head");
Currently, I have no solution for the first issue so I need help. For
the second one, I've fixed it like this:
$(document.createElement('script'))
.attr('src', scriptsPath + scriptFiles[idx] + ".js")
.attr('type', 'text/javascript')
.appendTo('head');
However, I was looking for a solution without having to use
createElement('script'), in other words, I would like to use jQuery.
Is it possible?