2

I know that this question has been asked many times ( but in different varuations), but I got totally confused...

I have a website with a right panel displaying some content - a set of links to news/inner articles. This is the same list for all site's pages. Thus, every time there is a new link/line in th news section, I have to go manually over all site's pages and update them. This is really annoying and time consuming.

The approach I though about is:

Adding a div where the news/link are supposed to be:

<div class"news"></div>

and load a JS file in all files. Upon window.onload(), what the JS will do is writing the news:

document.getElementByID('news').innerHTML=....

Thus, every time there is a new link/news, I will add it to the JS file, and it will be written in all site's pages ( because they all will load this script).

My Question is: Is this approach ok? Will the news/links that are generated this way be seen by (Goggle)?

P.S I have read many articles e.g https://stackoverflow.com/questions/11989908/can-google-crawl-links-generated-on-the-clientside-e-g-knockout

Googlebot doesn't see jquery generated content

http://support.google.com/webmasters/bin/answer.py?hl=en&answer=174992

Does google crawl javascript?

https://developers.google.com/webmasters/ajax-crawling/docs/getting-started

and more.... But got really confused... I am not using any AJAX or server side programming. Just want to do a simple .innerHTML ="..." with a predefined list of news, to save a lot of time. Will this content be indexed and seen by google?

Thanks a lot!

Community
  • 1
  • 1
Yura
  • 2,381
  • 8
  • 33
  • 44
  • I think you're fine. Because JS is client-side, I don't think GoogleBot will see it – Ben Thomson Sep 04 '12 at 14:12
  • @BenThomson: I think that the op want it to be seen... – Guffa Sep 04 '12 at 14:15
  • Yes, I DO want the links to be seen. The purpose of this automatic script is to avoid stupi copy-paste across all site's pages when I need to update a new link in the right panel. – Yura Sep 04 '12 at 15:02

2 Answers2

3

Generally, no. Google (and other bots) will not see content that you add dynamically.

They are of course learning the search engine to understand more and more, and it probably recognises some specific ways to add content to the page already, but to be able to see any dynamic content it would have to actually execute the script in a sandboxed environment, or emulate the script execution, to find out what it does.

Even if it does see some dynamic content, it's likely that it gives that content lower priority, so you are always better off by putting your important content as actual elements in the page.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
  • In that case, how can I put a certain piece of content in all my pages? I want to be able to change this content once and that it is changes automatically everywhere - Just as in programming laguages e.g. Java/C#. Because, what I am doing now is ultra unefficient copy-paste :P – Yura Sep 04 '12 at 15:04
  • @Yura: What capabilites do you have on the server side? If the server supports for example shtml, you can put the menu in one file and include it in all the pages. – Guffa Sep 04 '12 at 15:08
  • please let me say: You are the KING!! Tank you so much. I even did not know that such a thing exists, I read about it and tried it and it works perfect. Thank you so much! If the SSI support was not present in my host, what could I do? Is my only way out is DataBase and server side programmin e.g. PHP? – Yura Sep 04 '12 at 16:08
  • @Yura: If you use server scripting like for example PHP, then you have much more options to reuse the code. There are several different ways to include code, and you can put the data in a database if you like, but you don't need to. – Guffa Sep 04 '12 at 16:22
0

Any search engine crawler crawl only HTML code when you check source code in your browser. Now when you are fetching content using Javascript, it will not fetch in source code for sure. (Here it is depends how you fetch the content).

To test crawler visibility for your page, Google recommend LYNX tool here in webmaster guidelines.

http://support.google.com/webmasters/bin/answer.py?hl=en&answer=35769#2

Hope it will help !!