I am working on an old project and we're having an issue with telrik only in production. The radWindow opens up correctly but when we try to close it an errorr shows up:
Uncaught TypeError: Cannot read property 'radWindow' of null
This is the code for the called function:
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) {
oWindow = window.radWindow;
} else if (window.frameElement && window.frameElement.radWindow) {
oWindow = window.frameElement.radWindow;
}
return oWindow;
}
Then a .close() on the GetRadWinodw() function should close the popup. But what's weird is when I try on the console to get the "window.radWindow" it returns null and the "window.RadWindow" not null.
This is happening only on "NL" site and working on the other sites. I was thinking of case-sensitivity and also about setting some time out to load the object before calling the close() function, but as I said the same code is working on other sites...
Any idea what could be causing behavior? and is there a way to inject some javascript into the live site to override the existing function?
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
After some investigation it turns out that this has nothing to do with Telerik web ui because when I disable web security (chrome.exe --disable-web-security --user-data-dir) everything starts working
Any idea why I am having this issue (access denied to top.window.name , window.opener....) ? although I am on the same domain
Error:
"Uncaught SecurityError: Blocked a frame with origin from accessing a frame with origin The frame being accessed set "document.domain" to , but the frame requesting access did not. Both must set "document.domain" to the same value to allow access."
FYI: as I mentionned before, this is working for other coutry sites with the same code!
I’d like to know if same issue will appear when you view web page in other major browsers, or it just appear in Google Chrome.
Best Regards,
Fei Han
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
26 Points
70 Posts
Telerik UI : Cannot read property 'radWindow' of null
Aug 04, 2016 01:37 PM|medlag|LINK
Hi all,
I am working on an old project and we're having an issue with telrik only in production. The radWindow opens up correctly but when we try to close it an errorr shows up:
This is the code for the called function:
Then a .close() on the GetRadWinodw() function should close the popup. But what's weird is when I try on the console to get the "window.radWindow" it returns null and the "window.RadWindow" not null.
This is happening only on "NL" site and working on the other sites. I was thinking of case-sensitivity and also about setting some time out to load the object before calling the close() function, but as I said the same code is working on other sites...
Any idea what could be causing behavior? and is there a way to inject some javascript into the live site to override the existing function?
Thanks,
All-Star
40535 Points
6233 Posts
Microsoft
Re: Telerik UI : Cannot read property 'radWindow' of null
Aug 05, 2016 07:03 AM|Fei Han - MSFT|LINK
Hi medlag,
Firstly, please debug the code and add watches to object window to make sure if it contains a property named 'radWindow'.
Secondly, it seems that we could get radWindow object via this code from client side.
Besides, you could ask for help on Telerik forum.
http://www.telerik.com/forums/aspnet-ajax/window
Best Regards,
Fei Han
Member
26 Points
70 Posts
Re: Telerik UI : Cannot read property 'radWindow' of null
Aug 05, 2016 04:16 PM|medlag|LINK
Hi Fei Han,
Thank you for your reply.
After some investigation it turns out that this has nothing to do with Telerik web ui because when I disable web security (chrome.exe --disable-web-security --user-data-dir) everything starts working
Any idea why I am having this issue (access denied to top.window.name , window.opener....) ? although I am on the same domain
Error:
"Uncaught SecurityError: Blocked a frame with origin from accessing a frame with origin The frame being accessed set "document.domain" to , but the frame requesting access did not. Both must set "document.domain" to the same value to allow access."
FYI: as I mentionned before, this is working for other coutry sites with the same code!
Thanks,
All-Star
40535 Points
6233 Posts
Microsoft
Re: Telerik UI : Cannot read property 'radWindow' of null
Aug 09, 2016 11:03 AM|Fei Han - MSFT|LINK
Hi medlag,
I’d like to know if same issue will appear when you view web page in other major browsers, or it just appear in Google Chrome.
Best Regards,
Fei Han