Scripts question
-
My question is whether search engines will crawl the page before or after scripts run on the page. I have a H1 that will be replaced with a canvas by jquery script. Will search engines see the H1 or the canvas?
-
I mean 'view source' not generated source. What I tried to say is that Google will see exactly the same code as you do when you right click on a page and click 'View source code'. So to answer your first question _' I have a H1 that will be replaced with a canvas by jquery script. Will search engines see the H1 or the canvas?' _Just check the source code of your page to find out.
Javascript/ajax can cause problems for Google to index the content as far I know, but I'm not an expert in this.
-
Sorry but I'm still a bit confused.
By ”this code is equal to what you see in ’view source’”, do you actually mean “view source” or “view generated source”? Because “View source” would imply that Google sees the un-scripted html.
Could you really run javascript on a server? Do you mean that our server will run a client javascript before sending it to Google..? (Let’s say we add an A href tag dynamically by javascript, will this A tag be crawled by Google?)
Thanks!
-
Google doen't run your script, this happens on your server. When Google wants to crawl a page, it requests this url from your server. The server will run the scripts and deliver the final html to the Google crawler. This code is equal to what you see in 'view source'.
I hope this explains it a bit more.
-
Thanks, but can you please be more specific? Do you mean that search engines runs the scripts, then sees the final html – as in the html after scripts are executed? Or that they don’t run the scripts, so the “final html” is what we see in “view source” before the page is “finished” and scripts are executed?
Seems strange that Google would execute scripts. Wouldn’t that be a security risk?
-
Hi,
Search engines will index the final html, not the scripts that generate the html.
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
-
Removing Non Essential Scripts in WordPress to Boost Speed
If this is a duplicate post or someone has already asked this i do apologize. Ive been seeking help in increasing our page speed for sometime now and to no avail. https://tools.pingdom.com/#5e9dc9ab78000000 - Seems our page has just too many scripts which is a drag on the load time. We have a dedicated server and dont think its the issue as other websites on there load just fine.
On-Page Optimization | | ImageSalons
Something about this website www.catdi.com that just makes it top heavy. I've tried a CDN and that didn't work in fact it made it slower.. My question is i believe there's a way to remove, or combine all these scripts that are increasing our load time? Carlos3 -
SEO question
why does a business rank differ on google search and google maps (for example, a hair salon we do seo for ranks 5th for "hair salon in Dublin" on Google Maps and ranks 10th on Google search)
On-Page Optimization | | ryan.mamma0 -
Schema Question
I had ratings stars appearing on my site and recently started using the sale event schema, but the two won't show up at the same time, so the rating stars have now disappeared and have been replaced by sale event data. When looking around for more info I found the attached example which shows both appearing at the same time - however upon trying to replicate this myself with that same site I can't get both to appear. Does anyone know if it's possible for both schema data properties to appear in the results at the same time? save.png
On-Page Optimization | | meqdiw46ao0 -
Clickable Images Question
This may seem like a minor issue but it is something that has been bothering me. When I write a blog post and place images within the text, is it better to have the image linking to nothing or link to the image url. I am guessing that unless I wish the image to rank for a certain keyword then it is not worth it linking to the image url. But would just like clarification if there is a more deep seated reason. Thanks Mark
On-Page Optimization | | markmiton0 -
2 Canonical questions
QUESTION 1
On-Page Optimization | | Marketing_Today
I'm working on a site where a canonical link is implemented as That's not the normal format that I am used to, as I would have written it as Is that a problem? QUESTION 2
Why do so many sites these days have a sitewide canonical tag which refers to itself as the canonical?
For example: http://www.site.co.uk/page has a canonical of0 -
On page link question, creating an additional 'county' layer between states and zips/cities
Question We have a large site that has a page for all 50 states. Each of these pages has unique content, but following the content has a MASSIVE amount of links for each zip AND city in that state. I am also in the process of creating unique content for each of these cities and zips HOWEVER, I was wondering would it make sense to create an additional 'county' layer between the states and the zips/cities. Would the additional 'depth' of the links bring down the overall rank of the long tail city and zip pages, or would the fact that the counties would knock the on page link count down from a thousand or so, to a management 50-100 substantially improve the overall quality and ranking of the site? To illustrate, currently I have State -> city and zip pages (1200+ links on each state page) what i want to do is do state -> county (5-300 counties on each state page) -> city + zip (maybe 50-100 links on each county page). What do you guys think? Am I incurring some kind of automatic penalty for having 1000+ links on a page?
On-Page Optimization | | ilyaelbert0 -
New website launch - Dupilicate content question
Hi, We are going to be launching a US version of our UK E-commerce web store. The US version will be a standalone site, separate URL/hosting etc. My question is that the US website will carry the same products as the UK site - will the product copy have to be written differently for the US website in order to avoid any SEO duplicate copy? Thanks
On-Page Optimization | | WalesDragon0