admin管理员组

文章数量:1184884

In my ASP.NET site, I am using Telerik controls to bind date and time picker, and it works good in all browsers except IE 10, then I ran script debugger it says js error :

SCRIPT5007: Unable to get property 'documentElement' of undefined or null reference Telerik.Web.UI.WebResource.axd, line 166 character 2

Anyone knows, how to fix this problem ?

Thanks a lot!

In my ASP.NET site, I am using Telerik controls to bind date and time picker, and it works good in all browsers except IE 10, then I ran script debugger it says js error :

SCRIPT5007: Unable to get property 'documentElement' of undefined or null reference Telerik.Web.UI.WebResource.axd, line 166 character 2

Anyone knows, how to fix this problem ?

Thanks a lot!

Share Improve this question edited Dec 25, 2012 at 12:05 punter 4601 gold badge6 silver badges22 bronze badges asked Dec 24, 2012 at 14:25 ihorkoihorko 6,94526 gold badges80 silver badges123 bronze badges
Add a comment  | 

6 Answers 6

Reset to default 14

I added to my web.config (system.webServer) lines:

<httpProtocol>
  <customHeaders>
    <clear />
    <add name="X-UA-Compatible" value="IE=9" />
  </customHeaders>
</httpProtocol>   

and it fixed the problem.

Found the solution over here

Insert following code inside <head> tag,

<meta http-equiv="x-ua-compatible" content="IE=9">

Reposting my response in the Telerik forums:

For those of you, like us, who reverting to compatibility mode or upgrading are not good solutions at this time, we have a JavaScript patch that has a dependency on jQuery.

$(function(){
    if (typeof(window.$telerik.getLocation) == 'function' && Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version == 10) {
        window.$telerik.getLocation = function(a)
        {
            if (a === document.documentElement) {
                return new Sys.UI.Point(0, 0);
            }
            var offset = $(a).offset();        
            return new Sys.UI.Point(offset.left, offset.top);
        }
    }
});

One potential problem is that when a date or time picker element fades out, you can see the iframe behind it with the unstyled word "false" in it. Just something to bear in mind and watch out for if you decide to use this patch.

During our investigation, we also noticed that this version of RadDatePicker works fine IE11, just not IE10.

Original post can be found here: http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/getting-a-unable-to-get-property-documentelement-of-undefined-or-null-reference-error.aspx

You are getting this error because it seems that you are using an earlier version of Telerik. You should consider upgrade to the latest Telerik version if you target modern browsers such as IE 10.

References
Error in IE 10 due to telerik dlls Version=2009.2.826.35

The answer of ihorko worked fine for me. On windows 2008 server (IIS 7) do what ihorko proposed. If you work on a Windows 2003 server (IIS 6) use:

cscript adsutil.vbs set w3svc/HttpCustomHeaders "X-Powered-By: ASP.NET" "X-UA-Compatible: IE=9"

You can put the line in a bat file and run it from de c:\inetpub\adminscripts folder

Upgrade of Telerik suite is not as simple as paying the bill and copy a new dll. New versions do behave a little different and should be tested. Layout may change when using the telerik form decorator (an earlier 'bug' on margins has been solved but when corrected by code this correction will cause layout distortion after upgrade).

I found this post while I was looking for a solution to my DNN6 website. The error was almost the same

SCRIPT5007: Unable to get property 'documentElement' of undefined or null reference

I tried the solution suggested by ihorko and edited my web.config, but it didn't work for me. So let me share with you what I did to solve this: http://www.40fingers.net/WeblogsNews/Weblogs/tabid/58/ID/123/language/nl-NL/DotNetNuke-6-and-Internet-Explorer-10.aspx

Worked great for me!

本文标签: javascriptTelerik DatePicker in IE 10 is not workingStack Overflow