Problem with debugging JS file

Posted by Community Admin on 03-Aug-2018 14:56

Problem with debugging JS file

All Replies

Posted by Community Admin on 16-Oct-2012 00:00

I tried to debug my web app using FireBug.

$(".flexslider").flexslider(
        directionNav: false ,
        controlNav: true ,
        pauseOnAction: false ,
        pauseOnHover: true ,
        animation: "fade" ,
        animationDuration: 150 ,
        start: function(slider)


I set up a breakpoint at line "start:function(slider)". It entered some ScriptResource.axd and never returned back to the rest of the code following "start:function(slider)". All the codes after this line did not run!

I use
<sf:JavaScriptEmbedControl runat="server" id="jsLink1" ScriptEmbedPosition="BeforeBodyEndTag" url="~/scripts/scripts.js"></sf:JavaScriptEmbedControl>
to embed Javascript files. Does it mean there is some problem in the ScriptResource.axd file? Does anyone have a hint ?

Moreover, what is the usage of all these ScriptResource.axd files ? How are they generated ?

Posted by Community Admin on 19-Oct-2012 00:00

Hi,

Most probably the problem occurs in the start:function(slider), which calls an external js code. Maybe you're passing some invalid parameters to the function. As for the adx file - this is a resource file, where resources are combined, depending on the assembly they're located in. The idea of the ScriptResouce.axd is to reduce the requests to the server and optimize performance.

Kind regards,
Jen Peleva
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 19-Oct-2012 00:00

Yinfang,

Do you have jQuery added to the master page and is it loaded before your script runs?

I love bringing jQuery in via CDN but have resorted to doing the following, fewer issues...place it after the opening form tag in your template.

<sf:ResourceLinks ID="resourcesLinks" runat="server">
<sf:ResourceFile JavaScriptLibrary="JQuery" />
</sf:ResourceLinks>


Posted by Community Admin on 19-Oct-2012 00:00

After I changed the order of the JS files, the jQuery code works now.

Posted by Community Admin on 19-Oct-2012 00:00

The CSS and JS files, my company bought, already include some jquery.js file. I just manually include that file using JavaScriptEmbedControl tag. Anyway the problem is related to the loading order of the JS files.

This thread is closed