While testing my jQuery script in IE 9 it shows error in jquery-1.6.2.js —
SCRIPT5022: Exception thrown and not caught
jquery-1.6.2.js, line 548 character 3
My js file used to work with no problems in other browsers – firefox 3.6, 5.0, opera 11, chromium, chrome. I do not understand. Is there a bug in the jquery source or is there a bug in my js file ? How do I find it ?
It hasen’t been long since I started in this area so please I would really appreciate some ideas.
Thank you in advance.
[edited]
I’ve added the complete code.
I’ve learnt from :
http://net.tutsplus.com/tutorials/javascript-ajax/how-to-create-a-jquery-image-cropping-plug-in-from-scratch-part-ii/
I don’t know which part to add. The whole code does not fit in stackoverflow’s submit. says “body is limited to 3000 characters; you entered 42121 “
[2nd edit]
I have used ‘error’ in my ajax submit.
//jquery ajax submit for resizing
function submit(myform,e){
$n.val($image.attr('src').replace(/^[^,]*\//,''));
var mydata = myform.serialize();
$.ajax({
url: $myform.attr('action'),
cache: false,
type:$myform.attr('method'),
data: mydata,
success: function(response){
var img = $("<img />").attr('src', 'images/'+response+'?'+ e.timeStamp) //<-- img name here
.load(function() {
if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
alert('Incorrect image.');
} else {
$("#result").html(img); //<-- put cropped img here.
}
});
},
error: function(){ //<-- error used here
$('#result').html("Err. Loading Image");
}
});
};
I traced out my problem. IE prevented changing of attribute which let to the jQuery error.
from http://api.jquery.com/attr, just after 1st warning notice.
So I changed my code from earlier
to
and it solved my problem.
Thanks everyone.