Announcement

Collapse
No announcement yet.

freeindex slowing down our site!

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

    freeindex slowing down our site!

    Hi

    we use Freeindex for reviews, however I've noticed the script slows down our website as it waits for the freeindex widget to load.

    I was advised by their support that by "adding the tag "async" after the initial "script" tag in the HTML code. " this would prevent it from happening but having tried that with this code:-

    <script async type="text/JavaScript" src="http://www.freeindex.co.uk/widgets/fiwidget.asp?lid=74948%26tit%3DGibson+Doyle+Specialist+Cards%26wid%3D182%26agt%3D0%26rak%3D1%26dis%3D0%26wri%3D0%26nrv%3D2%26rts%3DS%26theme%3Dlight”></script><div style="width:182px;text-align:center;"><a style="font-family:Calibri;font-size:14px;" href="http://www.freeindex.co.uk/profile(gibson-doyle-specialist-cards)_74948.htm" rel="nofollow" target="_blank">

    The page loads much quicker but the widget has vanished and for this reason apparently it cannot be done using the async tag? Is there any other way it can be done?

    Any advice would be most appreciated.

    #2
    If you run just the script alone to call up the widget ie:
    http://www.freeindex.co.uk/widgets/f...6theme%3Dlight
    it takes (on my connection) about 3 seconds to show the widget.
    You can't make that time shorter, only option then is to stop it delaying your page load.

    You could try 'defer' instead of 'async' that would defer the script until the page has loaded.

    If that also stops the widget showing then try async="async" or defer="defer" as the tag instead.

    Ref:
    http://www.w3schools.com/tags/att_script_async.asp and
    http://www.w3schools.com/tags/att_script_defer.asp

    Comment


      #3
      It is loading in under 3 seconds now because I have temporarily replaced the widget with an image, we have another version of the widget on our testimonial page http://www.gibsondoyle.co.uk/acatalog/testimonials.html and that takes an age to load as well. especially on our slow broadband speed.... 3.5mbs.

      I'll try your suggestions later with the widget code and see if that fixes it.

      thanks

      Comment


        #4
        Just noticed you have run the widget without the rest of the page... takes about 3 secs with me as well but on our home page can be up to 10 secs and the page doesnt' load properly until the widget has crawled into place first

        Comment


          #5
          Ok tried to defer and this seems to work in that the page is parsed first, but the widget does not appear. I can see from my browser that the page is waiting for freeindex? Why isn't it appearing.

          Comment


            #6
            I don't know why I'm afraid but it does seem browser dependent. The widget loads with synch or defer in IE8 but not in the latest Chrome or Firefox - with a simple html test file that is, not your site.

            Comment


              #7
              I could be talking rubbish here, but I wonder if the problem could be that both async and defer allow the html to parse before the script is run. Presumably, if the page is fully parsed before the script runs then there's a chance there is no way for the widget to be displayed as the parsing is all done.
              -----------------------------------------

              First Tackle - Fly Fishing and Game Angling

              -----------------------------------------

              Comment


                #8
                You may well be right - I tried a simple html file containing only that script call with both synch and defer and it worked in IE8 but not in other browsers.

                The real problem here is the freeindex response time of course, we're just trying to mask that from the user.

                Perhaps calling the script from within an iframe might work as the parsing is presumably different then.

                Comment


                  #9
                  The test in IE8 might not be conclusive as I think IE didn't support asynch until IE10. So it might might only have passed as it the asynch was ignored anyway.
                  -----------------------------------------

                  First Tackle - Fly Fishing and Game Angling

                  -----------------------------------------

                  Comment


                    #10
                    Horrible cludge to load the code at the bottom of the page and move it where required after it eventually turns up.
                    Code:
                    <html>
                    <head>
                    
                    </head>
                    <body>
                    <h1>Test</h1>
                    Freeindex code will be placed here
                    <div id="freeindex_show" style="width:185px; height:350px; border:1px solid silver"></div>
                    Rest of page here.  
                    <br>
                    Rest of page here.  
                    <br>
                    Rest of page here.  
                    <br>
                    Rest of page here.  
                    <br>
                    Rest of page here.  
                    <br>
                    Rest of page here.  
                    <br>
                    Rest of page here.  
                    <br>
                    
                    At very bottom of page above the /BODY tag
                    <div id="freeindex_code" style="display:none">
                    <script type="text/JavaScript" src="http://www.freeindex.co.uk/widgets/fiwidget.asp?lid=74948%26tit%3DGibson+Doyle+Specialist+Cards%26wid%3D182%26agt%3D0%26rak%3D1%26dis%3D0%26wri%3D0%26nrv%3D2%26rts%3DS%26theme%3Dlight”>
                    </script>
                    <script type="text/JavaScript"></script>
                    </div>
                    <!-- Now move code to appropriate place after it has turned up -->
                    <script type="text/JavaScript">
                    	document.getElementById('freeindex_show').innerHTML = document.getElementById('freeindex_code').innerHTML;
                    </script>
                    </body>
                    </html>
                    Supplied as a standalone demo page. Save to desktop and run.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #11
                      Thank you all for your input,

                      Ive managed to get it to work with Normans code. Now our web pages parse first, before the widget, which is appearing in the right place where I want it to.

                      Something Freeindex technical support said couldn't be done!

                      Comment

                      Working...
                      X