errorPlacement: function(error, element) {
if (element.next().attr("id") == "errordiv") {
element.next().remove();
}
var msg = error.get(0).textContent;
error.insertAfter(element);
},
I want to get error content after jquery.validate function triggered. In the errorPlacement of the code blog as you see above error.get(0).textContent can provide msg in every browser except ie 8, I think this cause from JSON parsing problem in ie8, do you have any solution for this ?
Use
error.text()instead oferror.get(0).textContent.When you call
get(0)jQuery returns a DOM element at 0th index and IE8 do not supporttextContentproperty to a DOM element it hasinnerTextproperty which is equivalent totextContent. If you calltext()method on a jQuery object it will take care of cross browser issues and return the content correctly.