Solved

Why does my refresh take so long with the adding of links to a couple javascript libraries?

Posted on 2014-09-03
2
143 Views
Last Modified: 2014-09-03
I haven't researched this enough to know why so I was hoping someone could tell me why there was a noticeable delay (slow down) in my page refresh after I added some javascript and jQuery code (and library link references) to a page? Is it simply the time that it takes to go out through the internet (each time the page loads) to find these libraries that is causing the delay? Is there a way to improve the performance?

my javascript / jQuery

    <script type="text/javascript" src="http://cod.jquery.com/jquery-1.9.1.js"></script>
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
    <script type="text/javascript">

        var delay = (function () {
            var timer = 0;
            return function (callback, ms) {
                clearTimeout(timer);
                timer = setTimeout(callback, ms);
            };
        })();

        $(document).ready(function () {
            var updateWait = setTimeout(fadeUpdate, 3000);
            function fadeUpdate() {
                $("div.UpdatedMessage").fadeOut(1000);
            }
        });
    </script>

my HTML

        <div class="updateAlert">
            <asp:Panel runat="server" ID="pnlUpdateConfirmation" Visible="false" CssClass="UpdatedMessage Alert SavedSmall">
                <h3>
                    <asp:Label runat="server" ID="lblConfirmationMsg"></asp:Label></h3>
            </asp:Panel>
        </div>

Open in new window

0
Comment
Question by:mikesExpertExchange
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 40302322
you've jQuery twice lines 3 and 4, choose the more recent one until you need a specific version.
the last one compatibl with old browser is 1.11.1 : https://developers.google.com/speed/libraries/devguide?hl=fr#jquery

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

Open in new window

0
 
LVL 1

Author Closing Comment

by:mikesExpertExchange
ID: 40302333
BINGO! Thanks!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question