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
-
On Site Question: Duplicate H2...
Hi All A few on-site audit tools pull information on duplicate H2 tags on pages. This implies it's a bad thing and should be fixed - is that the case? On one of my sites the tag-line is in H2 in the header, so appears on every page... Just wondering if this is something worth fixing. Thanks
On-Page Optimization | | GTAMP0 -
Image Titles and Descriptions Question
Hello, I have a question about optimizing the SEO on my pages through image titles and descriptions. There are a few times on my website that I use the same image on multiple pages. I am under the impression that giving it a title such as "social-media-marketing-agency-graphic.jpg" will help the SEO for the phrase "social media marketing agency" on that page. My question was, if I want to use the same image on multiple pages, am I better off uploading an entirely new image with a new title to make it more relevant to the new page? Or will this not make large enough of a difference? Or is there an easier solution? Please let me know your thoughts on how to best optimize the pages
On-Page Optimization | | brightsocial0 -
Author Byline Question
What's the best practice for displaying author information at the beginning of an article? We're presently displaying it as: By <Author> • Jan 16, 2015 • <City>. We're considering making it even more concise by removing the term 'By'. Would be shooting ourselves in the foot if we did this? Any other ways we should optimize?
On-Page Optimization | | TheaterMania0 -
Having a terrible time ordering the CSS Styles and Scripts in my header
Hi Guys, I am having a terrible time trying to get the correct optimized (for speed, none blocking etc) order for loading my external css and JS. I follow the recommendations from Google Page Speed or Chrome Audit and it seems no matter where I move the CSS file too (top or bottom) it complains about more blocking and stopping rendering of the page. My URL is http://www.MyFairyTaleBooks.com if some smart person out there could help me figure out what I am doing wrong and the order in which my should be organized I'd appreciate it! Oh I'm not a developer but I can re-arrange text in a file! 😉 Thank you!
On-Page Optimization | | MyFairyTaleBooks
Dinesh0 -
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 -
Meta Description Question
Hi, Lets say you have a 1000 pages, is it ok to generate a template meta description and flip the keywords depending on the page? For example: Red Shoes page: Buy Red Shoes at amazing prices. We have a large range of Red Shoe sizes available. Blue Shoes page: Buy Blue Shoes at amazing prices. We have a large range of Blue Shoe sizes available. Thoughts?
On-Page Optimization | | Bondara0 -
I run a Q&A site, should I limit post questions to 64 characters?
I run a Q&A site (Recessionitis.com), should I limit posts (questions) to 64 characters for SEO purposes?
On-Page Optimization | | 10JQKAs0 -
Small Site Title Tag / Structure Question
Bit embarrassed to ask this question, but will ask it anyway! I have done some quite reasonable basic SEO for clients in the south of Spain with small sites and had reasonable success. My wife and I came to the Pyrenees in the south of France to take over and run bed and breakfast in a lovely old farm and some self-catering accommodation in one of the pastures (with my continuing to do a bit of work for clients too). We are running and developing the place for friends who are away 3-4 years. They had an abysmal site, so we designed one to together: http:www.loubetaspyrenees.com/ (I have given the French version because it's what I am most concerned with - there is an English version in case I can tempt you to a holiday here!) It's been very well received by users, so that's great. We have the place on about 12 agencies amd almost all link to our site, so it serves as a good showcase. Here's my issue (for the French site): It went online 11th Feb and is already doing well for more "long tail" searches, and for more local and specific searches, but is proving slow on our prime search terms. The prime market is French, and they key terms are "Gîtes" for the self-catering accommodation, and "Chambres d'Hôtes" for the Bed and Breakfast. Our key Geographical term for the French market is "Hautes Pyrenees" - it's a departmental area. In Google.fr We are around result 100 out of 600k results for "Chambres d'hôtes hautes pyrénées" and aren't in the first 200 for "Gîtes Hautes Pyrénées". This is a competitive market and we are competing with optimised and long-established agencies but still hope to do better. I know I am losing from poorly constructed title tags cannibablising the results, but cannot see how to solve this: Home Page Title tag: "Gîtes et Chambres d'Hôtes dans les Hautes Pyrénées | les Baronnies" I have two main pages on the Gîtes: Gîte for 2-3 people Title tag "Gîte dans les Hautes Pyrénées pour 2-3 personnes en les Baronnies"
On-Page Optimization | | PeterMurray
Gîte for 3-9 people Title tag "Location Gîte dans les Baronnies Pyrénées pour groupe 3-9 personnes" ("Location" means rental) Google understood the above and put us no 1 out of over 1miillion results for a search for a gite for 9 people in the south west of France ("gite sud ouest 9 personne") And 2 pages for the Bed and Breakfast: B&B in the farm building: "Chambres d'Hôtes dans les Hautes Pyrénées dans une ferme restaurée"
B&B in gite apartments with sitting rooms: "Chambres d'Hôtes dans les Hautes Pyrénées avec salon et terrasse" I am not sure how to handle the titles for the Home Page and for the 4 subpages - sounds silly, but have you any advice on how I might handle these titles better? I thought of using more general terms on the Home Page ("Holiday accommodation in the ..."), but on such a small site (18 pages in each language version) I feel that would be unwise. It seems I must try to find some way of differentiating the titles on the other 4 pages so that i am not cannibalising but where there are so few alternatives I am not sure how! Oh dear, sorry this was so long!0