2014-05-15 30 views
1

該網站在其他瀏覽器和IE版本中正常加載,但在IE8中我得到這個問題。我的網站未能在ie8中顯示結果HTML解析錯誤KB927917

網頁錯誤的詳細信息

用戶代理:Mozilla的/ 4.0(兼容; MSIE 8.0; Windows NT的6.1; WOW64;三叉戟/ 4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729。 NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E) 時間戳:2014年5月15日11:48:37 UTC

消息:HTML解析錯誤:無法在子元素關閉之前修改父容器元素(KB927917) 行:0 字符:0 代碼:0 URI:http://jobuzu.co.uk/?q=sales+assistant&l=

任何想法如何我可以解決這個問題?

而且這發生在IE8中的其他計算機....

function B(a) { 
    return document.getElementById(a) 
} 

function cf(a) { 
    var b = new Date; 
    b.setYear(b.getFullYear() + 1); 
    Ka("openSections", a, b) 
} 

function Ga(a) { 
    var b = String(document.cookie), 
     c = b.indexOf(a + "="); 
    if (c == -1) { 
     return ""; 
    } 
    var d = b.indexOf(";", c); 
    return b.substring(c + a.length + 1, d == -1 ? b.length : d) 
} 

function Ja(a) { 
    return unescape(Ga(a)) 
} 

function Ka(a, b, c) { 
    document.cookie = a + "=" + escape(b) + "; path=/" + (c ? "; expires=" + c.toGMTString() : "") 
} 

function La(a, b) { 
    document.cookie = a + "=;expires=" + (new Date(0)).toGMTString() + ";path=/" + (b ? ";domain=" + b : "") 
}; 

function ya(a,b) { 
    if (a) { 
     return RegExp("(^|\\s)" + b + "(\\s|$)").test(a.className) 
    } 
} 

function xa(a,b) { 
    if (a && !ya(a,b)) { 
     a.className ? a.className += " " + b : a.className = b 
    } 
} 

window.showAllRefinements = function(a) { 
    xa(B(a),"showAll") 
} 

window.toggleRefineBy = function(a) { 
    if (ya(B(a),"rbOpen")) { 
     var b = B(a); 
     if (b) { 
      b.className="rbSection"; 
     } 
    } else if (b = B(a)) { 
     b.className="rbSection rbOpen"; 
    } 
    b = Ja("openSections"); 
    b.match(":" + a + "(:|$)") == m ? b += ":" + a : b = b.replace(":"+a,""); 
    cf(b) 
}; 

window.delSearchCookie = function(a, b) { 
    a || (a = "RQ"); 
    $.removeCookie('csrf_token'); 
    /* 
    La(a, b); 
    */ 
    var c = B("recentsearches"); 
    c && c.parentNode.removeChild(c) 
} 

jquery.cookie.js:

/*! 
* jQuery Cookie Plugin v1.3.1 
* https://github.com/carhartl/jquery-cookie 
* 
* Copyright 2013 Klaus Hartl 
* Released under the MIT license 
*/ 
(function (factory) { 
    if (typeof define === 'function' && define.amd) { 
     // AMD. Register as anonymous module. 
     define(['jquery'], factory); 
    } else { 
     // Browser globals. 
     factory(jQuery); 
    } 
}(function ($) { 

    var pluses = /\+/g; 

    function raw(s) { 
     return s; 
    } 

    function decoded(s) { 
     return decodeURIComponent(s.replace(pluses, ' ')); 
    } 

    function converted(s) { 
     if (s.indexOf('"') === 0) { 
      // This is a quoted cookie as according to RFC2068, unescape 
      s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 
     } 
     try { 
      return config.json ? JSON.parse(s) : s; 
     } catch(er) {} 
    } 

    var config = $.cookie = function (key, value, options) { 

     // write 
     if (value !== undefined) { 
      options = $.extend({}, config.defaults, options); 

      if (typeof options.expires === 'number') { 
       var days = options.expires, t = options.expires = new Date(); 
       t.setDate(t.getDate() + days); 
      } 

      value = config.json ? JSON.stringify(value) : String(value); 

      return (document.cookie = [ 
       config.raw ? key : encodeURIComponent(key), 
       '=', 
       config.raw ? value : encodeURIComponent(value), 
       options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 
       options.path ? '; path=' + options.path : '', 
       options.domain ? '; domain=' + options.domain : '', 
       options.secure ? '; secure' : '' 
      ].join('')); 
     } 

     // read 
     var decode = config.raw ? raw : decoded; 
     var cookies = document.cookie.split('; '); 
     var result = key ? undefined : {}; 
     for (var i = 0, l = cookies.length; i < l; i++) { 
      var parts = cookies[i].split('='); 
      var name = decode(parts.shift()); 
      var cookie = decode(parts.join('=')); 

      if (key && key === name) { 
       result = converted(cookie); 
       break; 
      } 

      if (!key) { 
       result[name] = converted(cookie); 
      } 
     } 

     return result; 
    }; 

    config.defaults = {}; 

    $.removeCookie = function (key, options) { 
     if ($.cookie(key) !== undefined) { 
      // Must not alter options, thus extending a fresh object... 
      $.cookie(key, '', $.extend({}, options, { expires: -1 })); 
      return true; 
     } 
     return false; 
    }; 

})); 
+0

你能發佈你的代碼,特別是你的JavaScript嗎?也許這個問題類似於這裏:http://stackoverflow.com/questions/8905476/html-parsing-error-in-ie8kb927917 – kmoe

+0

這裏是主要的JavaScript代碼。 –

回答

0

嘗試在window.onload包裝你的代碼,就像這樣:

window.onload = function() { 

    //your code here 

} 

或者,如果您使用jQuery,您可以嘗試:

$(document).ready(function() { 

    //your code here 

}