Announcement

Collapse
No announcement yet.

External script file - which code?

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

    #16
    Hi Malcom

    Thanks.

    Is this the javascript on my homepage that you are refering to (listed below)? Is there any other script I should remove?

    <!-- START NorPrice Support -->
    <script language=JavaScript>
    <!-- V1.17
    var hidemain = 'CUSTOMVAR:MAINCURRENCY';
    var hidealt = 'CUSTOMVAR:ALTCURRENCY';
    var showonly = 'CUSTOMVAR:SHOWONLY';
    var hidefraction = CUSTOMVAR:HIDEFRACTIONRATE;
    var mainsymbol = 'CUSTOMVAR:MAINCURRENCYSYMBOL';
    var cgiurl = 'NETQUOTEVAR:CGIURL';
    function norpricepopup(){
    var arg = '';
    if ( arguments.length == 1 ) arg = '?' + arguments[0];
    var pricewin=window.open('NETQUOTEVAR:BASEHREFnorpricepopup.html' + arg, 'pricepop', 'height=100,width=400,toolbar=no');
    pricewin.focus();
    }
    //-->
    </script>
    <SCRIPT LANGUAGE="JavaScript" SRC="norpricesupport.js" TYPE="text/javascript"></SCRIPT>
    <style type="text/css">
    <!--
    .altprice {font-size: xx-small; color: darkblue;}
    -->
    </style>
    <!-- END NorPrice Support -->





    <!-- CSS Left hand nav -->

    <script type="text/javascript">
    function get_display_items(){
    // This function is run when the page is loaded
    // It checks the URL and if the URL contains the submenu name then it means that it has been
    // called from within a sub_menu
    // Therefore keep that submenu open
    var strParams;
    var strSub_Menu;
    var v_element;
    // Check if there are any variables
    if (self.location.search.indexOf('?') != -1) {
    strParams = String(self.location.search.substring(self.location.search.indexOf('?') + 1, self.location.search.length));
    } else {
    // No variables
    return;
    }
    // There is a submenu variables - so ensurethat all that sub menu is displayed
    // Currently it only works with one sub_menu being passed in
    // but could be developed further to take a parameter list of all sub_menus
    // quite a bit more complex, but still possible, depends upon the requirement

    strSub_Menu = String(strParams.substring(0,strParams.indexOf('=')));

    v_element = document.getElementById(strSub_Menu);
    v_element.style.display = "block";

    }

    function show_hide(submenu_name) {
    // This function is called when a sub menu is clicked
    // It then performs a flip of the display settings
    if (document.getElementById) {
    var v_element = document.getElementById(submenu_name).style;
    if (v_element.display == "block") {
    v_element.display = "none";
    } else {
    v_element.display = "block"
    }
    return false
    } else {
    return true
    }
    }

    </script>

    <!-- CSS Left hand nav ENDS -->
    KJ Beckett
    Men's Clothing & Accessories
    Cufflinks, Underwear, Ties, Grooming Products
    Bath, England
    Fast delivery to UK, USA and worldwide.
    Men's Fashion Blog

    Comment


      #17
      Google has improved it's reading of javascript a hell of a lot and continues to do so.
      Its nothing to do with googles ability to read java its to do with page depth. Spiders only go so deep on a page (about 100K) so if you have a huge mass of java in the head of a page the spider will never see your content. 5 lines of java make no difference but what you have does.

      You dont have to bother with an external file if you dont want you just need move it to the bottom of your page.

      To illustrate my point I recently did some SEO for a client the first stage of which was getting rid of a java menu system replacing it with an html one. The site has now jumped up the rankings for many search terms so IMO it does make a difference and the fact that Matt Cutts also suggests doing it - as he has for years - says alot.

      Comment


        #18
        Thanks

        You dont have to bother with an external file if you dont want you just need move it to the bottom of your page.
        I suppose a benefit of an external file is that it is in a central point and mutliple pages can be pointed to it PLUS it does reduce the page size abit - ok - only a few KB but every KB helps.
        KJ Beckett
        Men's Clothing & Accessories
        Cufflinks, Underwear, Ties, Grooming Products
        Bath, England
        Fast delivery to UK, USA and worldwide.
        Men's Fashion Blog

        Comment

        Working...
        X