The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. Using Javascript to Display Responsive Images?

    Using Javascript to Display Responsive Images?

    Technical SEO Issues
    3 3 110
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ShearingsGroup
      ShearingsGroup last edited by

      Hi

      We're making our new website responsive and are thinking of using a solution that would resize the images using javascript.

      So the image would be displayed like this <div data-src="/img/200x100.png">div>

      depending on what size fits the screen

      Is is okay for SEO? Or do we also need a fall back that doesn't use javascript?

      Thanks

      1 Reply Last reply Reply Quote 0
      • GPainter
        GPainter last edited by

        Google's not great at crawling java but its getting better however if its for images Google's not super great at images either so if you make good use of the alt tag you should be good for helping Google work out its a photo etc.

        I would more think of a fallback for if the user doesn't have java installed etc.

        1 Reply Last reply Reply Quote 0
        • canterburry
          canterburry last edited by

          It would be generally recommended you also include a

          <noscript><img src=""></noscript>

          section for crawlers and other visitors without JavaScript turned on. I would have at least hoped your solution would use the element rather than a completely non-standard

          approach to display images.

          Not sure what library, provider or script you are using but maybe check out a responsive image service like Pixtulate who would actually allow you to use a standard img tag and still accomplish what you are looking to do.

          1 Reply Last reply Reply Quote 1
          • 1 / 1
          • First post
            Last post
          • Images, CSS and Javascript on subdomain or external website
            JordanLowry
            JordanLowry
            0
            2
            1.4k

          • Using images from one domain on another?
            PatrickDelehanty
            PatrickDelehanty
            0
            4
            123

          • Can we use images from the internet of celebrities?
            TimHolmes
            TimHolmes
            0
            7
            173

          • CSS Float Top Left Image not displaying
            JustInsulation
            JustInsulation
            0
            13
            494

          • 301 redirect using javascript
            lcallander
            lcallander
            0
            6
            35.3k

          • Optimizing a website which uses JavaScript and jQuery
            Theo-NL
            Theo-NL
            0
            2
            426

          • How to attach at text to image that other websites use from my website
            melody-anne
            melody-anne
            0
            2
            489

          • Developing a drop down menu: Do I use javascript or pure css?
            PaulKMia
            PaulKMia
            0
            2
            1.2k

          Get started with Moz Pro!

          Unlock the power of advanced SEO tools and data-driven insights.

          Start my free trial
          Products
          • Moz Pro
          • Moz Local
          • Moz API
          • Moz Data
          • STAT
          • Product Updates
          Moz Solutions
          • SMB Solutions
          • Agency Solutions
          • Enterprise Solutions
          • Digital Marketers
          Free SEO Tools
          • Domain Authority Checker
          • Link Explorer
          • Keyword Explorer
          • Competitive Research
          • Brand Authority Checker
          • Local Citation Checker
          • MozBar Extension
          • MozCast
          Resources
          • Blog
          • SEO Learning Center
          • Help Hub
          • Beginner's Guide to SEO
          • How-to Guides
          • Moz Academy
          • API Docs
          About Moz
          • About
          • Team
          • Careers
          • Contact
          Why Moz
          • Case Studies
          • Testimonials
          Get Involved
          • Become an Affiliate
          • MozCon
          • Webinars
          • Practical Marketer Series
          • MozPod
          Connect with us

          Contact the Help team

          Join our newsletter
          Moz logo
          © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
          • Accessibility
          • Terms of Use
          • Privacy