Try Now
More in this section

Forums / General Discussions / Problem with debugging JS file

Problem with debugging JS file

5 posts, 0 answered
  1. Yinfang
    Yinfang avatar
    9 posts
    07 May 2012
    16 Oct 2012
    Link to this post
    I tried to debug my web app using FireBug.

            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 ?
  2. Jen Peleva
    Jen Peleva avatar
    568 posts
    10 Nov 2016
    19 Oct 2012
    Link to this post

    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
  3. Tim
    Tim avatar
    258 posts
    22 Jun 2011
    19 Oct 2012 in reply to Yinfang
    Link to this post

    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" />

  4. Yinfang
    Yinfang avatar
    9 posts
    07 May 2012
    19 Oct 2012 in reply to Jen Peleva
    Link to this post
    After I changed the order of the JS files, the jQuery code works now.
  5. Yinfang
    Yinfang avatar
    9 posts
    07 May 2012
    19 Oct 2012 in reply to Tim
    Link to this post
    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.
5 posts, 0 answered