Javascript not working on sub pages

Posted by Community Admin on 04-Aug-2018 10:25

Javascript not working on sub pages

All Replies

Posted by Community Admin on 23-May-2011 00:00

Hi..

just noticed a issue I'm slightly concerned about. I have a jquery plug in that works fine on the main pages but as soon as I place the page under another page the plug in fails. This doesnt seem right to me. Is there a fix for this? 

Reagrds Matt

Posted by Community Admin on 24-May-2011 00:00

Hello Matthew,

When testing with simple jQuery regardless of the number of page nestings it executes. Please provide the script you are using so we can examine the problem and provide you with solution.

Looking forward to your reply.

Best wishes,
Stanislav Velikov
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 24-May-2011 00:00

I'm having the same problem as well. I included jQuery using the script control in my template. All the roots pages works fine but the child pages doesn't work (no jQuery found in the source code). 

Posted by Community Admin on 25-May-2011 00:00

ok please find below the code I'm using. its for a simple tabs control which like I said in fist post works fine in main pages but not child pages. Is this an easy fix?

I have to say this is a major concern for me regarding sticking with sitefinity as my chosen CMS! we us a lot of jquery plugins in our sites.

"<script type="text/javascript" language="javascript">
        $(document).ready(function()
 
 
            $.featureList(
                $("#tabs li a"),
                $("#output li"),
                    start_item  :   1
                
            );
 
 
            /*
             
            // Alternative
 
 
             
            $('#tabs li a').featureList(
                output          :   '#output li',
                start_item      :   1
            );
 
 
            */
 
 
        );
    </script>
     
     
     
    <script type="text/javascript">
 
 
$(document).ready(function()
 
 
    //Default Action
    $(".tab_content").hide(); //Hide all content
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab
    $(".tab_content:first").show(); //Show first tab content
     
    //On Click Event
    $("ul.tabs li").click(function()
        $("ul.tabs li").removeClass("active"); //Remove any "active" class
        $(this).addClass("active"); //Add "active" class to selected tab
        $(".tab_content").hide(); //Hide all tab content
        var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
        $(activeTab).fadeIn(); //Fade in the active content
        return false;
    );
 
 
);
</script>"




kind Regards Matt

Posted by Community Admin on 26-May-2011 00:00

Hi Matthew,

I am still unable to reproduce the issue at my end so please provide some more information on your project. How do you insert the javascript to the page [ widget ( where do you point the scripts to be placed body,head), on the master page ... ] have you made some modifications to the administrative settings that handle scripts on pages, are you using some unsupported version of jQuery ( the installed version which sitefinity uses can be found Administration -->Advanced settings -->pages --> script manager --> script references ).

All the best,
Stanislav Velikov
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

This thread is closed