Skip to content Skip to sidebar Skip to footer

How Does Google Hide Html Source Of Search Results?

When you try to view the source code of a Google search results page you just see a bunch of javascript code instead of readable text. How does Google do that? I have searched thro

Solution 1:

Google builds the DOM with the javascript you noted. It does this for a number of reasons:

  • Decrease the load on the server to generate each dynamic result set with HTML markup.
  • Google returns the results in a JSON feed (example) - pastebin. Less processing power is required to produce the JSON response than a full HTML snippet or completely new page
  • Speed. Assuming that the user has a decent internet connection, the speed of the pages rendering on the client side compared to the server side is negligible.

As suggested above, jump into firebug and have a look around :)

Solution 2:

Google does that by generating the page using a pile of client side JavaScript. It's almost certainly a side effect, not a design goal.

Solution 3:

Google loads additional elements via Ajax, so you won't get them if you view the source. You can use something like Firebug to check the DOM elements after you make a new query.

Solution 4:

That link actually explains it quite clearly. The real point is, Google isn't "hiding" anything. There is an extra layer to all of this, which is called the DOM (Document Object Model). When a page is requested from a web server, the web server might respond with some basic HTML and a lot of JavaScript code. This response is then interpreted by your browser. It will load the HTML elements into the DOM, and then get started on churning through all of the JavaScript code, this JavaScript usually consists of a lot of instructions which manipulate the DOM (the in-memory representation of the page). It might load some extra data and insert new bits and pieces to display. The "browser window" if you like, renders whatever is in the DOM. Which is not necessarily the same as whatever is in the original request, because of all the instructions that have run even before the page is rendered inside your "browser window".

Post a Comment for "How Does Google Hide Html Source Of Search Results?"