+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / jQuery and SF3.7 SP4

jQuery and SF3.7 SP4

2 posts, 0 answered
  1. Duncan Evans
    Duncan Evans avatar
    122 posts
    Registered:
    07 Jul 2009
    17 Jun 2011
    Link to this post
    Evening,

    I have a JQuery script i would very much love to run. I'm no JQuery developer, so please excuse my ignorance regarding this. I have done much research on this and believe i am conflicting with Sitefinity's own scripts. I read that placing the code right before the ending </form> tag work, and it did for me too (Somewhat). Here is my code that i would like to implement into my MasterPages:

    <script type="text/javascript" src="../Scripts/reject/jquery.reject.js"></script>
    <script type="text/javascript">
        //<!--
        $(document).ready(function() { 
     
            $.reject({ 
                reject : {  all: true, // Covers Everything (Nothing blocked) 
                            msie5: true,msie6: true,// Covers MSIE 5-6 (Blocked by default) 
                            //msie: true,msie5: true,msie6: true,msie7: true,msie8: true, // MSIE Flags (Global, 5-8)
                            firefox: false,firefox1: true,firefox2: true,//firefox3: true,firefox4: true, // Firefox Flags (Global, 1-3)
                            //konqueror: true,konqueror1: true,konqueror2: true,konqueror3: true, // Konqueror Flags (Global, 1-3)
                            //chrome: true,chrome1: true,chrome2: true,chrome3: true,chrome4: true, // Chrome Flags (Global, 1-4)
                            safari: false,safari2: true,safari3: true,safari4: true,//safari5: true,safari6: // Safari Flags (Global, 1-4)
                            opera: false,opera7: true,opera8: true//opera9: true,opera10: true, // Opera Flags (Global, 7-10)
                            //gecko: true,webkit: true,trident: true,khtml: true,presto: true, // Rendering Engines (Gecko, Webkit, Trident, KHTML, Presto)
                            //win: true,mac: true,linux : true,solaris : true,iphone: true, // Operating Systems (Win, Mac, Linux, Solaris, iPhone)
                            //unknown: true // Unknown covers everything else
                },         
                display: ['firefox','msie','chrome','safari'], // Displays only firefox, chrome, and opera 
                browserInfo: { // Settings for which browsers to display 
                                firefox: { 
                                    text: 'Firefox 3.5+', // Text below the icon 
                                    url: 'http://www.mozilla.com/firefox/' // URL For icon/text link 
                                }, 
                                safari: { 
                                    text: 'Safari 5+'
                                    url: 'http://www.apple.com/safari/download/' 
                                }, 
                                chrome: { 
                                    text: 'Chrome 10+'
                                    url: 'http://www.google.com/chrome/' 
                                }, 
                                msie: { 
                                    text: 'Internet Explorer 8+'
                                    url: 'http://www.microsoft.com/windows/Internet-explorer/' 
                                }
                            }, 
                imagePath: '../App_Themes/Default/images/browsers/' // Path where images are located 
            }); 
     
        }); 
        //-->
        </script>

    Additionally, in trying to fix this error i ran into the Sitefinity Lightbox error. I belive this is partly why the above script did not work complete when placing the code before the closing </form> tag. Is the a resolution to this lightbox error? What control is causing it? And is there any way to remove it...

    Here is the full masterpage code:

    <%@ Master Language="C#" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <script runat="server">
     
    </script>
     
    <head runat="server">
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta name="msvalidate.01" content="2881AFB6CC2470EF4741C85DB896A455" />
        <meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />
     
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js?ver=1.4.0"></script>
     
        <script type="text/javascript" src="http://localhost/TheRecoveryPlace_net_v4/Scripts/reject/jquery.reject.js"></script>
     
        <script type="text/javascript">
            //<!--
            $(document).ready(function() {
     
                $.reject({
                    reject: { all: true, // Covers Everything (Nothing blocked) 
                        msie5: true, msie6: true, // Covers MSIE 5-6 (Blocked by default) 
                        //msie: true,msie5: true,msie6: true,msie7: true,msie8: true, // MSIE Flags (Global, 5-8)
                        firefox: false, firefox1: true, firefox2: true, //firefox3: true,firefox4: true, // Firefox Flags (Global, 1-3)
                        //konqueror: true,konqueror1: true,konqueror2: true,konqueror3: true, // Konqueror Flags (Global, 1-3)
                        //chrome: true,chrome1: true,chrome2: true,chrome3: true,chrome4: true, // Chrome Flags (Global, 1-4)
                        safari: false, safari2: true, safari3: true, safari4: true, //safari5: true,safari6: // Safari Flags (Global, 1-4)
                        opera: false, opera7: true, opera8: true//opera9: true,opera10: true, // Opera Flags (Global, 7-10)
                        //gecko: true,webkit: true,trident: true,khtml: true,presto: true, // Rendering Engines (Gecko, Webkit, Trident, KHTML, Presto)
                        //win: true,mac: true,linux : true,solaris : true,iphone: true, // Operating Systems (Win, Mac, Linux, Solaris, iPhone)
                        //unknown: true // Unknown covers everything else
                    },
                    display: ['firefox', 'msie', 'chrome', 'safari'], // Displays only firefox, chrome, and opera 
                    browserInfo: { // Settings for which browsers to display 
                        firefox: {
                            text: 'Firefox 3.5+', // Text below the icon 
                            url: 'http://www.mozilla.com/firefox/' // URL For icon/text link 
                        },
                        safari: {
                            text: 'Safari 5+',
                            url: 'http://www.apple.com/safari/download/'
                        },
                        chrome: {
                            text: 'Chrome 10+',
                            url: 'http://www.google.com/chrome/'
                        },
                        msie: {
                            text: 'Internet Explorer 8+',
                            url: 'http://www.microsoft.com/windows/Internet-explorer/'
                        }
                    },
                    imagePath: '/App_Themes/Default/images/browsers/' // Path where images are located 
                });
     
            });
            //-->
        </script>
     
    </head>
    <body class="template-home">
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager" runat="server">
        </asp:ScriptManager>
        <div id="page-wrapper">
            <div id="header">
                <div class="inner">
                    <div class="header-top">
                        <div class="logo">
                            <asp:ContentPlaceHolder ID="Logo" runat="server" />
                        </div>
                        <div class="top-right">
                            <div class="title">
                                <asp:ContentPlaceHolder ID="HeaderText" runat="server" />
                            </div>
                            <div class="phone">
                                <asp:ContentPlaceHolder ID="HeaderPhoneNum" runat="server" />
                            </div>
                            <div class="blue-chat">
                                <asp:ContentPlaceHolder ID="HeaderChatButton" runat="server" />
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <!-- END HEADER TOP -->
                    <div class="main-menu">
                        <asp:ContentPlaceHolder ID="MainMenu" runat="server" />
                        <div id="menu-search">
                            <asp:ContentPlaceHolder ID="MainMenuSearch" runat="server" />
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <!-- END MAIN MENU -->
                </div>
            </div>
            <!-- END HEADER -->
            <div id="hero-home">
                <div class="hero-home-wrap">
                    <div class="inner">
                        <div class="top">
                            <div class="title">
                                <asp:Image ID="imgBannerTxt" SkinID="sknBannerText" runat="server" /></div>
                            <div class="caption">
                                <asp:ContentPlaceHolder ID="BannerCaption" runat="server" />
                            </div>
                        </div>
                        <div class="live-chat">
                            <div class="title">
                                <asp:ContentPlaceHolder ID="ChatTitle" runat="server" />
                            </div>
                            <div class="caption">
                                <asp:ContentPlaceHolder ID="ChatCaption" runat="server" />
                            </div>
                            <div class="orange-chat">
                                <asp:ContentPlaceHolder ID="ChatButton" runat="server" />
                            </div>
                        </div>
                        <div class="orange-phone">
                            <asp:ContentPlaceHolder ID="PhoneNumber" runat="server" />
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                </div>
            </div>
            <!-- END HERO HOME -->
            <div id="content">
                <div class="inner">
                    <div class="content-main">
                        <div id="main">
                            <div id="tabs">
                                <asp:ContentPlaceHolder ID="ContentTabs" runat="server" />
                                <div class="clear">
                                </div>
                                <div id="tabs-1" class="main-inner">
                                    <div class="share-btns">
                                        <asp:ContentPlaceHolder ID="FacebookLikeButton" runat="server" />
                                    </div>
                                    <asp:ContentPlaceHolder ID="ContentHeader" runat="server" />
                                    <div class="home-left">
                                        <asp:ContentPlaceHolder ID="LeftContent" runat="server" />
                                    </div>
                                    <div class="home-body">
                                        <asp:ContentPlaceHolder ID="Content" runat="server" />
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <!-- END MAIN INNER -->
                            </div>
                            <!-- END TABS -->
                            <asp:ContentPlaceHolder ID="Controls" runat="server" />
                            <!-- END CONTROLS -->
                        </div>
                        <!-- END MAIN -->
                        <div id="sidebar">
                            <asp:ContentPlaceHolder ID="SideControls" runat="server" />
                            <asp:ContentPlaceHolder ID="CtrlsContinued" runat="server" />
                        </div>
                        <!-- END SIDEBAR -->
                        <div class="clear">
                        </div>
                    </div>
                    <!-- END CONTENT MAIN -->
                    <div id="footer">
                        <asp:ContentPlaceHolder ID="FooterButtons" runat="server" />
                        <div class="footer-inner">
                            <div class="col">
                                <asp:ContentPlaceHolder ID="FooterMenuBox1" runat="server" />
                            </div>
                            <div class="col">
                                <asp:ContentPlaceHolder ID="FooterMenuBox2" runat="server" />
                            </div>
                            <div class="col">
                                <asp:ContentPlaceHolder ID="FooterMenuBox3" runat="server" />
                            </div>
                            <div id="newsletter-signup" class="col last-col">
                                <asp:ContentPlaceHolder ID="NewsletterSignup" runat="server" />
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                        <div class="copyright">
                            <asp:ContentPlaceHolder ID="FooterCopyright" runat="server" />
                        </div>
                    </div>
                    <!-- END FOOTER -->
                </div>
            </div>
            <!-- END CONTENT -->
        </div>
        <!-- END PAGE -->
        </form>
    </body>
    </html>


    Please help, thanks...

    Duncan
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Jun 2011
    Link to this post
    Hi Duncan,

    Try using the built in js Library.

    http://www.sitefinity.com/blogs/georgichokov/posts/09-03-25/how_to_use_jquery_and_other_javascript_libraries_in_sitefinity.aspx

    Most probably the version of jQuery you use conflicts with the default scripts version.

    Greetings,
    Ivan Dimitrov
    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
2 posts, 0 answered