Pages

Friday, April 22, 2011

Fix for - jQuery Error on IE 8.0 for append function.

While using append() function in jQuery, you may see some errors popping out while loading the page.
This issue usually happens in Internet Explorer 8.0 version and will work perfectly in Firefox. 
 
jQuery Function: 
append: function() {
 return this.domManip(arguments, true, function(elem){
  if (this.nodeType == 1)
        this.appendChild( elem )  });
 },
Replace the append function with the below code,
append: function() {
  return this.domManip(arguments, true, function(elem){
   if (this.nodeType == 1)
           try{this.appendChild( elem )}
           catch(err){ }
  });
 },
 
Hope this will help you ;-) 
 

4 comments:

  1. Thanks Mate, you save my life.

    ReplyDelete
  2. Same issue, this solution worked like a charm. Thanks!

    ReplyDelete
  3. Gracias ,estube buscando la solucion por dias .

    ReplyDelete
  4. @Enoc Espinosa - eres bienvenido...

    ReplyDelete