This is a migrated thread and some comments may be shown as answers.

[Solved] 'fx' is null or not an object error

10 Answers 134 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ashok
Top achievements
Rank 1
Ashok asked on 01 Apr 2011, 03:10 PM
Whenever our MVC site detects Session timeout and Session timeout page is displayed, in bottom window we see javascript error:
'fx' is null or not an object. All pages inherit from same _Layout.cshtml, but error happens only for Session timeout page. How can we resolve this?

10 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 04 Apr 2011, 08:08 AM
Hi Tejas,

 Unfortunately this is not a known issue. Could it be that the Scripts folder is not excluded from ASP.NET authentication and as a result the JavaScript files fail to load? You can check with Fiddler or Firebug if there are any failing HTTP requests when there is a session timeout. Alternatively you can open a support ticket and send us a running sample project which reproduces the JavaScript error.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ashok
Top achievements
Rank 1
answered on 11 Apr 2011, 03:44 PM
Hi Atanas,

I will check with fiddler etc and let you know. However my general observation is whenever Session timeout happens and if I am debugging with scripts, 'fx' null or not an object error comes from telerik.window.min.js file.

Thanks,
0
Alex Gyoshev
Telerik team
answered on 12 Apr 2011, 07:06 AM
Hello Tejas,

This error may occur only if the telerik.window.js file is included before telerik.common.js or if the page calls the open() or close() methods of the window. Perhaps this information will help you with finding the issue.

Kind regards,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ashok
Top achievements
Rank 1
answered on 12 Apr 2011, 05:26 PM
Alex,

You are right. On a page where I get 'fx' is null or not an object, I checked the page source and telerik.common.js is not present.

Here is my question:
My web.config has:
<telerik>
  <webAssets useTelerikContentDeliveryNetwork="true" /></telerik>


My _layout.cshtml is like as follows:
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    @(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.outlook.css").Combined(true).Compress(true)))
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="page">
        <div id="header">
                  </div>
        <div id="main">
                        @RenderBody()
        </div>
        <div id="footer">
            @Html.Raw(@LocalizedText.FooterText)
        </div>
    </div>
    @(Html.Telerik().ScriptRegistrar()
                    .jQuery(true)
                    .Scripts(s => s.Add("~/Scripts/MicrosoftAjax.js")
                                   .Add("~/Scripts/MicrosoftMvcAjax.js")
                                   .Add("~/Scripts/jquery.unobtrusive-ajax.min.js")
                                   .Add("~/Scripts/2011.1.315/telerik.draganddrop.min.js")
                                   .Add("~/Scripts/2011.1.315/telerik.window.min.js")
                                   .Add("~/Scripts/json2.js")
                                   .Add("~/Scripts/Project.js"))
                    .DefaultGroup(group => group.Combined(true).Compress(true)))
</body>
</html>

We are creating telerik window at client side (jQuery) as a result we have included window.js via ScriptRegistrar.
I am realying on
<telerik> <webAssets useTelerikContentDeliveryNetwork="true" /></telerik>


to populate other .js files. However on a page where I get 'fx' error, source shows me .js files, I have in ScriptRegistrar.
I don't see "common.js" in source.








Do I have to include manually this file?




0
Dimo
Telerik team
answered on 13 Apr 2011, 08:00 AM
Hi Tejas,

Yes, you have to include the telerik.common.js file manually, just like you are doing it for the other Telerik MVC JS files. Please refer to:

http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-required-javascript-files.html

Kind regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ashok
Top achievements
Rank 1
answered on 18 Apr 2011, 05:00 PM
Ok.. so now if I look at my html source, I see 2 telerik.common.min.js (one added by CDN and one I added by me) in most of the paged. However on Session Timeout page, common.js via CDN is missing.

Any idea why?
0
Dimo
Telerik team
answered on 18 Apr 2011, 05:05 PM
Hi Tejas,

Please check this forum thread:

http://www.telerik.com/community/forums/aspnet-mvc/general/script-tag-rendered-twice.aspx#1609937

Greetings,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ashok
Top achievements
Rank 1
answered on 18 Apr 2011, 05:25 PM
Following the suggestion of the link, I don't even see what scripts gets added to my page: This section goes missing from view source.
so I can't tell, if duplicate files gets added or not.

<script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/jquery-1.5.1.min.js"></script>

 

 

<

 

script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.common.min.js"></script>

 

 

<

 

script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.panelbar.min.js"></script>

 

 

<

 

script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.list.min.js"></script>

 

 

<

 

script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.calendar.min.js"></script>

 

 

<

 

script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.datepicker.min.js"></script>

 

 

<

 

script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.textbox.min.js"></script>

 

 

<

 

script type="text/javascript" src="http://aspnet-scripts.telerikstatic.com/mvcz/2011.1.315/telerik.grid.min.js"></script>

 

 

<

 

script type="text/javascript" src="/Ecp/Scripts/MicrosoftAjax.debug.js"></script>

 

 

<

 

script type="text/javascript" src="/Ecp/Scripts/MicrosoftMvcAjax.debug.js"></script>

 

 

<

 

script type="text/javascript" src="/Ecp/Scripts/jquery.unobtrusive-ajax.min.js"></script>

 

 

<

 

script type="text/javascript" src="/Ecp/Scripts/2011.1.315/telerik.common.min.js"></script>

 

 

<

 

script type="text/javascript" src="/Ecp/Scripts/2011.1.315/telerik.draganddrop.min.js"></script>

 

 

<

 

script type="text/javascript" src="/Ecp/Scripts/2011.1.315/telerik.window.min.js"></script>

 

0
Dimo
Telerik team
answered on 19 Apr 2011, 09:34 AM
Hi Tejas,

I guess I was not clear enough in my previous replies.

The ScriptRegistrar adds automatically to the page all script files required by Telerik MVC extensions, but only for those extensions that are displayed on initial page load. The ScriptRegistrar does not add script files for extensions that are displayed after an AJAX request.

The jQuery source is registered on all pages, which have a ScriptRegistrar on them. The telerik.common.js file will be registered on all pages, which have at least one Telerik MVC extension (initially) on them.

With this information in mind, please inspect once again your ScriptRegistrar configuration and check what script files should be added manually for components that are added with an AJAX request.

Also check whether you are not trying to display a partial view as a standalone page.

If your problem persists, please send us a standalone runnable demo for local inspection. Thanks.

Best wishes,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Phillip
Top achievements
Rank 1
answered on 20 Jun 2012, 05:14 PM
Is there any way to get around it happening when you call page.open() or page.close()? I need to open a new page which should display a telerik chart.
Tags
General Discussions
Asked by
Ashok
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Ashok
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Dimo
Telerik team
Phillip
Top achievements
Rank 1
Share this question
or