Hi all, in addition to the post "Detecting AJAX Support" by Ed C. I want to know, if there''re any ideas, discussions or strategies, how to implement a "search-engine-friendly" detection of an AJAX (or non-AJAX) support. We all know the problems with AJAX and search engines. Is "Ajax.getTransport()" the only solution? Any other ideas? PS: avoid RoR-specific answers, because I use "scriptaculous" with PHP... (be ashamed ;-) Greetinx Michael --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
On 9/19/06, Michael <mail-u1jPNj63thlNl3dD/f30obNAH6kLmebB@public.gmane.org> wrote:> Is "Ajax.getTransport()" the only solution?What is wrong with this feature detection? You want to check if the User Agent supports some feature, then the best way is to test for this feature. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Martin Bialasinski wrote:> > Is "Ajax.getTransport()" the only solution? > > What is wrong with this feature detection?Search engines don''t execute JavaScript, do they? We could use something like (pseudo code): if Ajax.getTransport() = true then do something like Ajax.Update() /* load the first page */ If this condition is not executed, we assume that the client can''t run scriptaculous/AJAX and could be a search engine. My question to the community is, if there''re any other (better) ideas? -- Michael --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
On 9/20/06, Michael <mail-u1jPNj63thlNl3dD/f30obNAH6kLmebB@public.gmane.org> wrote:> My question to the community is, if there''re any other (better) ideas?What are your evaluation criteria for "better"? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
As you can read in my original post, I asked if there''re any ideas, discussions or strategies, how to implement a "search-engine-friendly" solution (in any way). A little bit brainstorming, you know? :-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
On Sep 20, 2006, at 12:54 AM, Michael wrote:> If this condition is not executed, we assume that the client can''t run > scriptaculous/AJAX and could be a search engine.If it''s a search engine that can''t run JavaScript, there''s not going to be anything you can do in that browser session to check that the condition wasn''t executed. No JavaScript, after all. :)> My question to the community is, if there''re any other (better) ideas?If your concern is primarily about search engines, you''d probably be better off with either a user-agent detection check on the server side, or using the old standby <noscript></noscript>. -Clay -- Killersoft.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Ok, here is my solution (if anybody wants to know)... and it seems to work: <div id="searchengines">content for search engines</div> var ajaxSupport = (Ajax.getTransport()) ? true : false; if (ajaxSupport = true) { new Element.update(''searchengines'', ''''); window.setTimeout(''Ajax.Update(\''human_page\'')'', 500); } The "content for search engines" (see <div>-tag above) includes the content of the start-page (with keywords describing the site etc.) and static links to sub pages. A search engine "reads" this page, follows links and does NOT execute the JavaScript off course. The page (or some content-elements on the page) will be updated immediately (ok, after 500ms) in a browser with JavaScript by Ajax.Update(). Further navigation is done by AJAX. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Your website might get banned by Google: http://ma.gnolia.com/people/tobie/bookmarks/scoscuste regards, Tobie On 4 oct. 2006, at 07:28, Michael wrote:> > Ok, here is my solution (if anybody wants to know)... and it seems to > work: > > <div id="searchengines">content for search engines</div> > > var ajaxSupport = (Ajax.getTransport()) ? true : false; > if (ajaxSupport = true) { > new Element.update(''searchengines'', ''''); > window.setTimeout(''Ajax.Update(\''human_page\'')'', 500); > } > > The "content for search engines" (see <div>-tag above) includes the > content of the start-page (with keywords describing the site etc.) and > static links to sub pages. A search engine "reads" this page, follows > links and does NOT execute the JavaScript off course. > > The page (or some content-elements on the page) will be updated > immediately (ok, after 500ms) in a browser with JavaScript by > Ajax.Update(). Further navigation is done by AJAX. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve aka TDD
2006-Oct-04 12:04 UTC
Re: scriptaculous, AJAX and search engines
Michael a écrit :> var ajaxSupport = (Ajax.getTransport()) ? true : false;a.k.a. "var ajaxSupport = !!Ajax.getTransport();> if (ajaxSupport = true) {Ahem. With a single = sign, you''ll reassign ajaxSupport, and therefore ensure it''s true. Beware! This is why I always put rvalues on the left side: if (3 == myVar) Also, this code is redundant. It could as well be: if (ajaxSupport)> new Element.update(''searchengines'', ''''); > window.setTimeout(''Ajax.Update(\''human_page\'')'', 500);What is this Ajax.Update thing? -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve aka TDD
2006-Oct-04 12:05 UTC
Re: scriptaculous, AJAX and search engines
Hello Tobie, Tobie Langel a écrit :> Your website might get banned by Google: > > http://ma.gnolia.com/people/tobie/bookmarks/scoscusteThis is wonderful FUD. I see nothing whatsoever on the Google guidelines referred to by this article, that says anything about banning. Especially since Google *is* pretty smart about AJAXy pages. After all, they use the technology all over the map. So, what exactly did you mean by that? What info did you allude to? -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
The single = sign: oops, sorry - you''re quite right. Should one of the following: if (ajaxSupport == true) {} if (ajaxSupport) {} if (Ajax.getTransport()) {} And the Ajax.Update() thing should be pseudo code. Sorry for the lack of clarity. It should be the scriptaculous function "Ajax.Updater()", see: http://wiki.script.aculo.us/scriptaculous/show/Ajax.Updater Let me describe my idea in another way: on the first page there''s a <div>-tag with the id="searchengines". This <div> contains the content of all pages (very small web-site) or static links to the pages (a kind of link-list). Furthermore the first page contains the JavaScript part to check if the current client has AJAX capability. If AJAX is not supported (ajaxSupport==false) or the JavaScript is not executed (e.g. the client is a search engine), there is just the start page with the static links (for human-visitors AND for search engines). If the client has AJAX capability the content of the <div>-tag (id="searchengines") is cleared (or its visibility is hidden) and the page is updated by Ajax.Updater(...) with content of the second page (e.g. the first static link on the link-list). Conclusion: a modern web-browser with AJAX support doesn''t see the content of the <div>-tag because it''s cleared as soon as possible and the page-content is updated with the second page. A search engine or a very old browser without AJAX support sees the <div>-tag with links to the pages (and may follow them). These are the same pages as updated by AJAX - but more "static"... you know? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
I think Tobie meant the problem with cloaking: if a site doesn''t meet Google''s quality guidelines, it may be blocked from the index. A mechanism to show different page content for search engines or for human-visitors is strictly prohibited. On the one hand Tobie is right, because my solution uses a kind of "hidden text" and two different ways to deliver the content to the clients (one for clients with AJAX support and one without). On the other hand you can argue that delivery method is not cloaking: the page contents are stored in a database and there''re no differences if you access the page by AJAX or by static links. The pages are the same! It''s just a nicer layout/design if the client has AJAX capability. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Hi Michael, I actually wrote a small rant about this issue on my blog which you can find here: http://tobielangel.com/bytesandpieces/2006/10/05/ajax- no-nos/ (I''ve been heavily hit by comment spam lately, so comments are moderated for the moment and will thus not appear immediately). Quite by coincidence, I am currently working on a plugin that will do just what you are looking for but will remain accessible, unobstrusive, and will not get you in trouble with google ;-) (not that in your case the latter really was not an issue considering what you wrote below). I''ll let you know as soon as it is released. Regards, Tobie On 7 oct. 2006, at 18:47, Michael wrote:> > I think Tobie meant the problem with cloaking: if a site doesn''t meet > Google''s quality guidelines, it may be blocked from the index. A > mechanism to show different page content for search engines or for > human-visitors is strictly prohibited. > > On the one hand Tobie is right, because my solution uses a kind of > "hidden text" and two different ways to deliver the content to the > clients (one for clients with AJAX support and one without). On the > other hand you can argue that delivery method is not cloaking: the > page > contents are stored in a database and there''re no differences if you > access the page by AJAX or by static links. The pages are the same! > It''s just a nicer layout/design if the client has AJAX capability. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Am 08.10.2006 um 00:44 schrieb Michael:> And the Ajax.Update() thing should be pseudo code. Sorry for the lack > of clarity. It should be the scriptaculous function "Ajax.Updater()", > see: > > http://wiki.script.aculo.us/scriptaculous/show/Ajax.Updater >Just for clarification, Ajax.Updater is class in Prototype, not script.aculo.us (which is an add-on to Prototype). Best, Thomas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---