Announcement

Collapse
No announcement yet.

Will Sellerdeck javascripts run asynchronously?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Will Sellerdeck javascripts run asynchronously?

    Hi

    We've been experiencing a few problems with poor page loading speeds on our site.

    One of the key issues (as reported by Google PageSpeed Insights) is that there are numerous 'render blocking javascripts' on all of our web pages, which have to be completed before the page is loaded.

    One solution would be to add the async tag to these scripts to allow them to run asynchronously, rather than waiting for each one to complete.

    Does anyone know whether this would work with the Sellerdeck scripts (as well as various plug-ins and widgets that we use)? Or would it be likely to cause major issues?

    Any help / advice would be much appreciated!

    Many thanks

    Jon

    #2
    I've tried adding async for every javascript on this product page:

    http://www.buybrandtools.com/acatalo...dge_Tuner.html

    For the most part it works. It's improved page speed. Just one problem I can spot - if you press F5 to refresh, the contents of the Item Specifics tab jump below the Description, and you can no longer click on the Item Specifics tab.

    Which script might be causing this please?

    Thanks

    Jon

    Comment


      #3
      You're doing something risky. The speed and sequence things load at will vary per customer, depending on their internet connection and what's already in their cache. Pages you look at are likely to be cached (you'r your own best customer probably). What you see may not be the same as others get.

      I've seen several site where people have done this and have had instant (or worse - intermittent) trouble until the async's were removed.

      Here's an example of why it's a bad idea. On your page linked to above you have:
      Code:
      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" async></script>
      <script>
      $(document).ready(function() {
      var jPM = .......
      </script>
      The first line loads jQuery (but not right away due to the async) and the following lines try to use jQuery to do something. They will fail if jQuery doesn't load instantaneously!
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        And a P.S. The line:
        Code:
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" async></script>
        isn't needed as SellerDeck has earlier loaded jQuery 1.11.1 as standard.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Thanks Norman, that's very helpful. I didn't feel convinced that just adding async tags everywhere would be a very safe thing to do!

          We have 15 'render blocking' javascripts on the page. Do you have any suggestions on how these could be loaded asynchronously or deferred to speed up the page load time?

          Cheers

          Comment


            #6
            Probably only the peoplewho wrote each of these JavaScripts can give definitive answers.

            And since they didn't defer their loading they probably didn't write them with such a capability in mind.

            As I've pointed out jQuery (probably the biggest one) isn't safe to defer.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Okay, thanks Norman, that's a fair point.

              There are other issues I've addressed that have greatly improved page speed now, so I'll leave the idea of adding async to scripts.

              Thanks for your help.

              Jon

              Comment

              Working...
              X