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
-
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 -
Url permalink structure question!
Hello! I just read the "15 SEO Best Practices for Structuring URLs" but I have still a question: My A version bellow "20 accessoires" has no meaning in french. If I add "voyage" (version B), then is it considered as spammy? I mean the "voyage" keyword repetition? A) http://www.lytchee.com/preparer-son-voyage/20-accessoires/ B) http://www.lytchee.com/preparer-son-voyage/20-accessoires-voyage Thanks for advices! Sylvain
On-Page Optimization | | lytcheetv0 -
Another anchor text question
Hi, We are updating a site and creating new separate pages for each coworker (app. 50 coworkers). Each page will include picture, short description, cv and also a subtitle/"keyword list" called: "areas of expertise". Each keyword (area of expertise) has it´s own in depth page on the subject, would it be wise to anchor text -link these? or is this something that is likely to be picked up by google as spam? Thanks!
On-Page Optimization | | Agguk
/Anders0 -
Too Many on page links on my homepage question?
Question, on moz analytics, for my homepage, I've gotten the " Too many on page links" notification every crawl. I've always ignored it because i didnt think it affected ranking or anything really. The on page links on the bottom of our homepage are landing pages. Most users reach those pages by searching those specific pages on google. We just decided to put them on the bottom of our page for unknown reasons. My question is, should i remove the landing pages on the bottom of our homepage? WIll it improve search rankings for my homepage? if i do remove them, should i put the landing pages on another page besides the homepage? Does google index my website better without the on page links on my homepage? My website is- prestigeluxuryrentals.com
On-Page Optimization | | prestigeluxuryrentals.com0 -
Question about overoptimization and images "alt"
Hello, I own a shop with lots of categories, in each category there is a lot of pictures, some have already alt, must I put the attribute alt in all images, it would be 100% beneficial for my site or could would I be over-optimizing the site? Thank you
On-Page Optimization | | yuyuyu0 -
A question on cached pages
Hi all. I have been testing different ways of writing the text on the homepage of the website www document-management-solutions co.uk because we are ranking very low for the keyword Document Management Software. I've recently learnt about pages being 'cached' and wanted to just clarify something. The last time the page was cached was on 26th March. I have made changed to the homepage since then and wanted to see how it has affected our ranking. Will I not be able to know if it has had a positive/negative effect until the next time our page is cached? Thanks
On-Page Optimization | | janc0 -
Rel canonical tag question
Im trying to to fix my duplicate content problem with my catagory pages in my shopping cart. I have read about adding a rel canonical tag to the page so it links back to the main catagory page. So if I add a rel canonical tag to the main catagory page it will show up on every other page for that catagory like page 1 page 2 and so on and it will have the tag linking back to the main cat. That should fix it it right? Now that being said I cant seem to add the tag invetween the head tags. I can add it to the body where I can add content. Will the rel canonical tag work outside the head tags? Any other ideas on this fix? I contacted my people that host the cart to see if they have any features to help this will see what they say.
On-Page Optimization | | Dataken0