Solved

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

Posted on 2014-09-03
2
134 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now