Using Javascript to Display Responsive Images?
-
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
-
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.
-
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.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
What Tools Do I USe To Find Why My Site No Longer Ranks
Hi, I made the mistake of hiring a freelancer to work on my website [in2town.co.uk](link url) but after having a good website things went from bad to worse. The freelancer was kicked off the platform due to lots of compliants from people and creating backdoors to websites and posting on them. It cost me money to have the back door to our site closed. I then found lots of websites were stealing my content through the rss feed. Two of those sites have now been shut down by their hosting company. With all these problems I found in Feb that the hundreds of keywords that I ranked for had vanished. And all the ones that were in the top ten for many years have also vanished. When I create an article which includes https://www.in2town.co.uk/skegness-news/lincolnshire-premier-inn-staff-fear-for-their-jobs/ they cannot be found in Google. Normally before all these problems, my articles were found straight away. If I put in the title name Lincolnshire Premier Inn Staff Fear For Their Jobs and then add In2town in front of it, then instead of the page coming up with the article, it instead shows the home page. Can anyone please advise what tools i should be using to find out the problems and solve them, and can anyone offer advice please on what to do to solve this.
Technical SEO | | blogwoman10 -
Google Showing wrong image in the SERPS
Hi Guys, In organic SERPS Google pulling incorrect product image, instead of product image its showing image from relevant products, Checked the structured data, og:image everything is set to the product image, not sure why google showing images from relevant product sidebar, any help, please?
Technical SEO | | SpartMoz0 -
Using meta keywords
Hello, I've read conflicting opinions regarding the use of meta keywords. I know Matt Cutts stated a few years ago that Google does not use them as a ranking signal but many still use them. This raises a few questions: 1. Is there any reason to still use meta keywords? 2. Isn't it just a way to let your competitors know what you're optimizing for? 3. How do other search engines treat meta keywords? Thanks!
Technical SEO | | mirel0 -
Affects of multiple subdomains on homebrew CDN for images
We're creating our own CDN such that instead of serving images from http://mydomain.com/images/shoe.jpg It will appear at all of the following subdomains: http://cdn1.mydomain.com/images/shoe.jpg http://cdn2.mydomain.com/images/shoe.jpg http://cdn3.mydomain.com/images/shoe.jpg http://cdn4.mydomain.com/images/shoe.jpg Image tags on our pages will randomly choose any subdomain for the src. The thought was this will make page loading faster by paralellizing requests across many cookie-less domains. How does this affect : -Ranking of images on Google image search. -Ranking of pages they appear on -Domain authority (images are linked to heavily in our social media efforts, so we will 301 redirect image urls to cdn1.mydomain.com) Should we disallow all but one CDN domain in robots.txt? Will robots.txt on an image only subdomain even be retrieved? Should we just use 1 CDN subdomain instead?
Technical SEO | | cat5com0 -
How oftern should I use press relese
We are using press release agency to publish our new products/brands/offers. I realise this would increase our links. Would this be a good method and would those links be permanent? Can I publish as many as I want so I end up with many good links from trust source? Am I doing the right thing?
Technical SEO | | LauraHT0 -
Comments in slider using display: none
What is the best way to get comments indexed that are hidden in a slider using display: none? For example: http://www.coupondudes.com/stores/kmart.com Click on "Add comment" Is there a way to do this without changing the design? If not, should we create a page per coupon with the comments shown. Will that pose duplicate content issues? 20110512-qg1ra18k9khdsqi6j3rkq4dfgb.jpg
Technical SEO | | 58phases0 -
Javascript
Hi mozzers, For my website I use various affiliate programs on commission junction. Some of the text ads are in javascript. Will google read the text ads or not? Cheers, Peter
Technical SEO | | PeterM220 -
Best way to display maintenence mode on a website?
I have a website with lots of traffic and sometimes the backends fail. I want to use lighttpd to show that the website is under mantenence and should be back up shortly. I was thinking of using Soft 503 errors or doing a 302 for every page to /maintenance.html. What would you do (besides fixing the backends, we are already doing that :P) to avoid hurting your SEO efforts? Thanks in advance Mariano
Technical SEO | | marianoSoler980