Announcement

Collapse
No announcement yet.

Problem with Act_sections_tree.js and Act_sections_trees_URLS.js

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

    Problem with Act_sections_tree.js and Act_sections_trees_URLS.js

    Im having a problem with my site.
    Aesthetically it is looking pretty good at the moment but these two files are making initial page loading times very long and im worried that users are going to jump ship before they have even got round to looking at the site.

    Act_section_tree.js is currently 191kb
    Act_section_tree_URLS.js is currently 78kb

    These two files are my main concern although others are causing a problem to. there are 5 others each at over 25kb.

    I make it a total of 418kb before the user has even seen any info. Even on broadband people might click off before the pages have loaded.

    I wondered if it was possible to trim these anywhere.
    My website is http://www.mobile-spares-n-repairs.c...g/sitemap.html

    Im wondering if it is possible to make the menu bar generate plain html. I know i could edit the links in the Act_Primary.html file but i dont know enough about html to make the colours and text size stay the same as it is now. Ive tried to do it but the links dont look good at all and the site then looks as though its a DIY job.

    Any help would be appreciated. Im sure others have come accross this problem at some point before.

    thanks
    http://www.irwebonline.com

    #2
    I'm on dial-up in Turkey and your home page loaded reasonably fast. I even did a full refresh just to be sure.

    Luckily modems do zip like compression (LZW actually) and as the Act_section_tree.js is highly compressible text it zips down to only 16K or so and maybe is 30K when coming down the line.

    As to Act_section_tree_URLS.js I don't see any refernce to this file on you home page so perhaps it's not being downloaded at all.

    Now here's my recurrent moan to Actinic regarding this. There's a HUGE amount of repeated in iformation in the URL portion of the Act_section_tree.js. E.g.
    Code:
    var section_tree = new CreateArray(13);
    section_tree[1].sName = "Battery";
    section_tree[1].sURL = "http://www.mobile-spares-n-repairs.co.uk/cgi-bin/ss000001.pl?SECTIONID=Irwebonline%5fBattery%5f1%2ehtml&NOLOGIN=1";
    section_tree[1].sImage = "";
    section_tree[1].nSectionId = "1";
    section_tree[1].nImageWidth = "0";
    section_tree[1].nImageHeight = "0";
    section_tree[1].pChild= new CreateArray(16);
    section_tree[1].pChild[1].sName = "Alcatel Battery";
    section_tree[1].pChild[1].sURL = "http://www.mobile-spares-n-repairs.co.uk/cgi-bin/ss000001.pl?SECTIONID=Irwebonline%5fAlcatel%5fBattery%5f4%2ehtml&NOLOGIN=1";
    section_tree[1].pChild[1].sImage = "alcatel-logo.jpg";
    section_tree[1].pChild[1].nSectionId = "4";
    section_tree[1].pChild[1].nImageWidth = "100";
    section_tree[1].pChild[1].nImageHeight = "100";
    section_tree[1].pChild[2].sName = "Bosch Battery";
    section_tree[1].pChild[2].sURL = "http://www.mobile-spares-n-repairs.co.uk/cgi-bin/ss000001.pl?SECTIONID=Irwebonline%5fBosch%5fBattery%5f5%2ehtml&NOLOGIN=1";
    Why not store the base URL once ("http://www.mobile-spares-n-repairs.co.uk/cgi-bin/ss000001.pl?SECTIONID=") at the beginning and then only store the changing bit ("Irwebonline%5fBattery%5f1%2ehtml") to the generated arrays.

    Here's the same code as above tidied up and with all the variable names shortened.
    Code:
    var baseURL = "http://www.mobile-spares-n-repairs.co.uk/cgi-bin/ss000001.pl?SECTIONID=";
    var URLSuffix = "&NOLOGIN=1"
    var st = new CA(13);
    st[1].sN = "Battery";
    st[1].sU = "Irwebonline%5fBattery%5f1%2ehtml";
    st[1].sI = "";
    st[1].nI = "1";
    st[1].nW = "0";
    st[1].nH = "0";
    st[1].pC= new CA(16);
    st[1].pC[1].sN = "Alcatel Battery";
    st[1].pC[1].sU = "Irwebonline%5fAlcatel%5fBattery%5f4%2ehtml";
    st[1].pC[1].sI = "alcatel-logo.jpg";
    st[1].pC[1].nI = "4";
    st[1].pC[1].nW = "100";
    st[1].pC[1].nH = "100";
    st[1].pC[2].sN = "Bosch Battery";
    st[1].pC[2].sU = "Irwebonline%5fBosch%5fBattery%5f5%2ehtml";
    Only 622 bytes instead of the original 1023. Smaller, wot?

    Norman
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment

    Working...
    X