Announcement

Collapse
No announcement yet.

Adding Javascript to Page Header

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

    Adding Javascript to Page Header

    Hi everyone been ages since my last post as I always seem to find the info I am looking for in the Community or Knowledge base.

    I would like to know the best place to add a JavaScript so it runs on the Header of every page. Its basicly to direct Mobile phone users to a nice layed out cut down version of my website for phone users only, as desktop versions of Actinic / Seller Deck as of yet don't the mobile features of Actinic Online.

    I would like to place this JavaScript so it does affect the site for normal non mobile shoppers and doesn't effect our Google Rankings .

    The Code is as follows:

    <script type="text/javascript">
    /* START OF MYMCART.COM SCRIPT */
    var mobiletarget = "http://scoot.mymcart.com/m/meechs-menswear";
    document.write("<scr"+"ipt src='//www.mymcart.com/javascript/detect-mobile.js?tm="+ new Date().getTime()+"'><\/script>");
    /* END OF MYMCART.COM SCRIPT */
    </script>
    www.meechs.co.uk

    #2
    Anyone have any advice?
    www.meechs.co.uk

    Comment


      #3
      "Standard Javascript Header Functions" in the design library is a global area for all Javascript.

      Comment


        #4
        Thanks Lee for the help as always
        www.meechs.co.uk

        Comment


          #5
          I throught I found the place to put this code but Seller Deck is putting acatalog into the live code on the site as below.

          <script type="text/javascript">
          /* START OF MYMCART.COM SCRIPT */
          var mobiletarget = "http://scoot.mymcart.com/m/meechs-menswear";
          document.write("<scr"+"ipt src='acatalog///www.mymcart.com/javascript/detect-mobile.js?tm="+ new Date().getTime()+"'><\/script>");
          /* END OF MYMCART.COM SCRIPT */
          </script>

          How do I stop this happening?
          www.meechs.co.uk

          Comment


            #6
            Either:

            Put http: in front of //www.mymcart.com/

            Or change the javascript to obfuscate the src=
            E.g. "<scr"+"ipt sr" + "c=
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Thank you Norman that did the trick.
              www.meechs.co.uk

              Comment

              Working...
              X