Reputation:
Will the contents and rendering output be indexed by Google and other search engines?
Code:
<script>
var html = '<!DOCTYPE html>';
html += '<html>';
html += '<head>';
html += '<meta charset="utf8" />';
html += '<title>This Is The Stacked Overflown Network</title>';
html += '<meta name="description" value="i, are, description, ized" />';
html += '<meta name="keywords" value="key, words, and, all, that" />';
html += '</head>';
html += '<body>';
html += '<h1>The Stacked Overflown Network</h1>';
html += '<hr />';
html += '<p>Will I get the opportunity to be indexed at the Googol Seek Engine?</p>';
html += '<p><strong> - No! You Will Not! And bye bye!</strong></p>';
html += '</html>';
html += '</html>';
html += "\n";
document.write( html );
</script>
Upvotes: 2
Views: 242
Reputation: 27525
That's definitely not a good style of writing Webpages.
Many crawlers don't run JavaScript at all.
Though it may be possible that JavaScript source code gets indexed to some extent, this content is very unlikely to get high rating. The result of the script may be indexed by Google, but some crawlers just won't get your content.
Upvotes: 1
Reputation: 700152
Crawlers doesn't run the Javascript in the page, so any information in a script is very likely to be ignored.
Some crawlers might try to parse some information from some scripts, but generally it won't be indexed at all. If you have some information that you want to be indexed, you should put it where the crawler can very easily find it.
If a crawler would consider any information inside a script, it would have to be sure that the information actually ended up in the page. Otherwise it would be easy to use that to put a lot of invisible keywords in a page, similar to how some used to put text with the same color as the background in the page to try to fool the crawlers.
Upvotes: 0