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 Should I Use To Investigate Damage to my website
I would like to know what tools I should use and how to investigate damage to my website in2town.co.uk I hired a person to do some work to my website but they damaged it. That person was on a freelance platform and was removed because of all the complaints made about them. They also put in backdoors on websites including mine and added content. I also had a second problem where my content was being stolen. My site always did well and had lots of keywords in the top five and ten, but now they are not even in the top 200. This happened in January and feb. When I write unique articles, they are not showing in Google and need to find what the problem is and how to fix it. Can anyone please help
Technical SEO | | blogwoman10 -
Rank regional homepages using canonicals and hreflangs
Here’s a situation I’ve been puzzling with for some time: The situation
Technical SEO | | dmduco
Please consider an international website targeting 3 regions. The real site has more regions, but I simplified the case for this question. screenshot1.png There is no default language. The content for each regional version is meant for that region only. The website.eu page is dynamic. When there is no region cookie, the page is identical to website.eu/nl/ (because Netherlands is the most important region) When there is a region cookie (set by a modal), there is a 302 redirect to the corresponding regional homepage What we want
We want regional Google to index the correct regional homepages (eg. website.eu/nl/ on google.nl), instead of website.eu.
Why? Because visitors surfing to website.eu sometimes tend to ignore the region modal and therefor browse the wrong version.
For this, I set up canonicals and hreflangs as described below: screenshot2.png The problem
It’s 40 days now since the above hreflangs and canonicals have been setup, but Google is still ranking website.eu instead of the regional homepages.
Search console’s report for website.eu: screenshot3.png Any ideas why Google doesn’t respect our canonical? Maybe I’m overlooking something in this setup (combination of hreflangs and canonicals might be confusing)? Should I remove the hreflangs on the dynamic page, because there is no self-referencing hreflang? Or maybe it’s because website.eu has gathered a lot of backlinks over the years, whereas the regional homepages have much less, which might be why Google chooses to ig nore the canonical signals? Or maybe it’s a matter of time and I just need to wait longer? Note: I’m aware the language subfolders (eg. /be_nl) are not according to Google’s recommendations. But I’ve seen similar setups (like adobe.com and apple.com) where the regional homepage is showing ok. Any help appreciated!0 -
Using 410 To Remove URLs Starting With Same Word
We had a spam injection a few months ago. We successfully cleaned up the site and resubmitted to google. I recently received a notification showing a spike in 404 errors. All of the URLS have a common word at the beginning injected via the spam: sitename.com/mono
Technical SEO | | vikasnwu
sitename.com/mono.php?buy-good-essays
sitename.com/mono.php?professional-paper-writer There's about 100 total URLS with the same syntax with the word "mono" in them. Based on my research, it seems that it would be best to serve a 410. I wanted to know what the line of HTACCESS code would be to do that in bulk for any URL that has the word "mono" after the sitename.com/0 -
Using a 302 redirect for language variants. How should I use the canonical?
Hi there, I have a question regarding the canonical tag. The current setup is like so... www.site.com 302 redirects to.. www.site.com/de/ I want to add canonical tags on every page to avoid duplicate content but I'm not sure about the homepage. Should the canonical URL be www.site.com or www.site.com/de/ ? I'm concerned that I could be about to hurt my ranking. Thanks,
Technical SEO | | zuriwolf
Mitch0 -
Image Duplication
I'm feeling strong! Ok, so can Google penalise a website which has "duplicated images" - coming from a completely independent website?
Technical SEO | | GaryVictory0 -
Use of iFrames to embed video content?
So we decided to add interesting video content we have shot ourselves to improve the user experience on our website. We have read though all the SEO material and advice we could find and decided to use Vimeo to host our videos instead of self-hosting. The videos themselves will not show up on Vimeo or Google as we set our account to 'private', but we notice that to embed the videos on our website - the embed code is an iFrame. My question's are, aren't iFrames supposed to be bad for SEO? Should we look to another video hosting solution instead? If other websites embed our videos on their site using the iFrame, do we get any SEO credit or the backlink? Thx.
Technical SEO | | Liam-Web0 -
How to display the full structure of website on Google serps
I have been searching around but unable to gather information as to how we can control or list top pages of a website on Google's first page , i.e. if we type seomoz in google , we can see the main listing with 6 subdomain listings , which link to Blog , Seo tool , Beginner Seo guide , Learn Seo , Pricing & Plans and login My question is can we control these listings i.e. what to display and what not , and if yes how can we make this type of visibility on first page , by using html or xml sitemaps or theirs something mostly websites are missing. Cause this type of data is coming up for very less websites and mostly websites are with single urls. c43Ki.jpg
Technical SEO | | ngupta10 -
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