I have resolved the issue by downloading the uncompressed version of jquery1.2.3.js. I looked for the line that cause the error. It was 1061. The code was... if(set) elem[name] = value; return elem[name];
I had to remove this code to get jquery to work in IE. This is a major problem. I'm not sure if the lack of this code will have repercusions. Advice please.
The following jquery code works fine in Firefox but throws and error in IE. Can someone please help. Any advice?
The error states...
Invlalid Argument
jquery1.3.2.js Line 12
Code:0 Char: 12949
When I remove the inline function mylib.showreel.init(); the error disappears so the actual error is caused by the floloowing ocde and not jquery.
showreel :
{
init : function() {
$('#showreel-content').hide();
$('#showreel').addClass('loading');
$.ajax({
type: "GET",
url: "/xml/showreel.xml",
dataType: "xml",
success: function(xml) {
var total = $(xml).find('site').length;
var randnum = Math.floor(Math.random()*total);
$(xml).find('site').each(function(entryIndex, entry) {
if(entryIndex === randnum){
var title = $(this).find('title').text();
var color = $(this).find('color').text();
var url = $(this).find('url').text();
var website = $(this).find('website').text();
var image = $(this).find('image_src').text();
$('#head-contact,#head-contact a').css('color',color);
$('body.home #nav li#home').css('border-bottom','1px solid' + color);
$('<div id="info"></div>')
.html('<div class="entry" style="color:' + color + '">' + title + '<a href="'+url+'"><br />'+website+'</a></div>')
.appendTo('#header-content');
//create new image object to preload image
var img = new Image();
//once image has loaded execute this code
$(img).load(function () {
//$(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already
$(this).hide();
$('#showreel').removeClass('loading').append(this);
$(this).fadeIn('slow');
}).error(function () {
// notify the user that the image could not be loaded
}).attr('src', image);
}
});
}//end success function
});//end ajax function
}//end init
}//end showreel