Announcement

Collapse
No announcement yet.

Turn off Javascript in Mobile

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

  • Turn off Javascript in Mobile

    Ok not exactly as the topic says.

    I have a bit of code that allows you to turn things on or off in different views, for instance I have turned off the side bars in mobile view.

    I was wondering if I could take this further and turn off any javascript or css files in mobile view in order to speed the website up in mobile view.

    So does anyone know of any javascript, css or any files that I could turn off in mobile view safely without damaging the website?

    Many thanks

    Regards

    Jason
    Silver Jewellery from Tianguis Jackson and Geti Titanium Rings
    Titan Jewellery Men's Titanium Wedding Rings and Tungsten Wedding Rings
    Titanium Jewellery

  • #2
    Hi. I can't help you with the Javascript. However I would be really interested in seeing your existing code. I would like to turn on 2 sidebars on the home page and turn them off for the rest of the site. Also turn off coupon codes on catalog pages in the mobile view.

    Many thanks Tony
    Tony
    www.secretgardenquilting.co.uk

    Comment


    • #3
      Hi Tony,

      Not sure this code is what you are after for turning sidebars off on selected pages, but it will remove coupon codes on mobile view.

      https://blog.hubspot.com/marketing/s...ers-can-see-ht
      Regards

      Jason
      Silver Jewellery from Tianguis Jackson and Geti Titanium Rings
      Titan Jewellery Men's Titanium Wedding Rings and Tungsten Wedding Rings
      Titanium Jewellery

      Comment


      • #4
        turn off any javascript or css files in mobile view
        You'll be crippling a lot of functionality. JavaScript handles the menu, dynamic pricing, filtering, etc, etc. And CSS files are what give a site it's look (including the mobile look).
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


        • #5
          Hi Norman,

          Iím aware of that, but just wondered if there was anything desktop specific that I can turn off in mobile view. For instance do they use different javascript menus?

          I am after turning anything off in mobile view that is desktop specific. I realise this is very dangerous and I would be treading a fine line between success and breaking the site.

          are all javascript and css files interwoven, or can they be isolated to mobile and desktop?
          Regards

          Jason
          Silver Jewellery from Tianguis Jackson and Geti Titanium Rings
          Titan Jewellery Men's Titanium Wedding Rings and Tungsten Wedding Rings
          Titanium Jewellery

          Comment


          • #6
            Extremely difficult to do and probably not worth the effort.

            I looked at the qualitysilver site and the SellerDeck files actinic.css, jquery-1.11.1.min.js and sellerdeck.min.js combined come to 410Kb. Your home page loads 1.5Mb of assorted files - many of which are non-SellerDeck add-ons. So if you managed to half the size of these 3 SD files (which would be a vast amount of work - if possible) you'd save 205Kb which is only a 13% overall saving.

            The saving is actually less than that as the above figures are for the full size of the files.

            Firefox shows that you are using compressed transfers so the 3 SD files come to 99Kb and the whole page is 732Kb leading to a saving of only 7% if you reduced these files by half.

            And remember that these files are identical on every page viewed, so they should only be loaded once and will be cached for subsequent page views.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


            • #7
              Hi Buzby,

              The real question is why would you want to disable CSS/JS for mobile users?

              If your goal is page load time, as Norman has mentioned - you need to reduce the size / change the loading times of your other files.

              Jonathan recently posted on the thread regarding adding other files to the SD JS minification array, and compressing these using uglify JS - a process I'm currently undertaking in order to reduce https requests. (https://community.sellerdeck.com/for...th-extra-files)

              After your initial DOM load of ~2s, you then spend a further 2s slowly connecting to all of your social elements - Pinterest/Twitter and the likes. I'd look at loading these async if possible.

              While playing on the site, I've seen that around 980px your side bars both break and go below the main content, adding additional height to the page.
              Matt. M - SMR Enterprises Ltd.

              Comment


              • #8
                This was just about turning off unused files, for instance BXslider on mobile when I didnt want to use a slider in mobile view.

                With Norman's post above it kind of clarified the small amounts I was chasing, many thanks Norman.

                Instead I have gone down the CDN route instead which is working very well.

                Many thanks
                Regards

                Jason
                Silver Jewellery from Tianguis Jackson and Geti Titanium Rings
                Titan Jewellery Men's Titanium Wedding Rings and Tungsten Wedding Rings
                Titanium Jewellery

                Comment

                Working...
                X