Friends need help to resolve this issue.
(function($){
$('*').each(function(){
if ($(this).children().length == 0) {
$(this).html($(this).html().replace(avidno,'<span id=avidlocal>AvidTrak Tracking Number</span>'));
}
});
})(jQuery)
Since the following line is what’s giving you the error:
you should break it up so that only one method is being called per line. This will allow you to further isolate the error. For example:
If the
var currentHTMLline is the issue, then $(this) is probably undefined for some reason. Or perhaps you need quotes around the id name “avidlocal”. Hard to say, since this is an IE bug after all, and I don’t see anything specific that I know doesn’t work in IE.As a final note, I would strongly advise your friend to find a better way to achieve what he’s aiming. $(‘*’).each will loop through every single element on the page. Does your friend really not have any way of producing HTML that allows the “avidno” text to be more easily replaced, i.e. more easily accessed via jQuery (through a class/id) than by looping through everything and checking if they have children nodes?