Forum Moderators: Robert Charlton & goodroi
Yet those looking closely at their server logs may notice that Google is now requesting links that don't appear directly in JavaScript -- links that get put together on the fly and Google could not possible know about unless it could execute at least part of that JavaScript code.
Mark Drummond, chief executive of Wowd, a unique search engine company we profiled in the magazine earlier this year, explains in an email why understanding JavaScript is "a very deep, very hard, and very classic computer science problem."
He explains that the challenge is in figuring out whether or not the JavaScript code ever stops running. "The halting problem is undecidable," he writes. He says there is no known algorithm that can be applied to any program, at any point, and tell whether or not that program continues ad infinitum. The fact has been mathematically proven.
Drummond, whose search company avoids some of these complexities by tapping humans to do its indexing, notes that it would possible to simplify the problem and merely determine, for example, whether or not the Web application has made a data request to Facebook. Presumably, that's what Google is currently doing. [blogs.forbes.com...]
who would put links in JavaScript for GoogleBot to find
Google is constantly trying new ideas to improve our coverage of the web. We already do some pretty smart things like scanning JavaScript and Flash to discover links to new web pages,...
Of course you will likely have links requiring JavaScript for Ajax functionality, so here's a way to help Ajax and static links coexist:
When creating your links, format them so they'll offer a static link as well as calling a JavaScript function. That way you'll have the Ajax functionality for JavaScript users, while non-JavaScript users can ignore the script and follow the link. For example:
<a href=”ajax.htm?foo=32” onClick=”navigate('ajax.html#foo=32'); return false”>foo 32</a>
JavaScript improvements[searchengineland.com...]
Google has also been crawling some JavaScript for a while. Primarily, they’ve been extracting very simply coded links. As of today, they’re able execute JavaScript onClick events. They still recommend using progressive enhancement techniques, however, rather than to rely on Googlebot’s ability to extract from the JavaScript (not just for search engine purposes, but for accessibility reasons as well).
Googlebot is now able to construct much of the page and can access the onClick event contained in most tags. For now, if the onClick event calls a function that then constructs the URL, Googlebot can only interpret it if the function is part of the page (rather than in an external script).
Some examples of code that Googlebot can now execute include:
<div onclick="document.location.href='http://foo.com/'">
<tr onclick="myfunction('index.html')"><a href="#"
onclick="myfunction()">new page</a>
<a href="javascript:void(0)" onclick="window.open
('welcome.html')">open new window</a>
These links pass both anchor text and PageRank.
And what is stopping the server code from not sending the client side scripts to spiders/bots requests?
webmasters *do* want bots like Googlebot to see the site the way that users do