Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have an external JS file embedding some content inline in a web page.

Basically it just does a document.write("my content") via a script tag and loaded externally with the src attribute.

Any chance for this content to be indexed?

Answer seems obviously negative but I have a slight hope while crawlers have surprising abilities.

share|improve this question
add comment

4 Answers 4

up vote 3 down vote accepted

No, they won't see such content.

share|improve this answer
2  
This is not strictly true. Google can index JavaScript generated content to some degree, and it is only going to get better. I manage an old site that has an incredulous amount of document.write() content and some of this is indeed indexed. However, it is certainly very hard for search engines to index and notoriously unreliable, but there is certainly a "chance". –  w3d Sep 22 '12 at 19:57
add comment

The noscript tag won't help much

http://productforums.google.com/forum/#!category-topic/webmasters/crawling-indexing--ranking/FEqhhborItY

One of the problems with noscript is - as others have mentioned - that it's been abused quite a bit by spammers, so search engines might treat it with some suspicion. So if this is really important content, then I wouldn't rely on all search engines treating your noscript elements in the same way as normal, visible, static content on your pages. If this is "just" for comments, then that might be worth considering regardless, especially if the alternatives are much more complicated

share|improve this answer
add comment

Yeah it is possible that this part can be visible in the search engines , there is a project called #! (hash bang) according to this if you have any javascript code introduced in yourpage you can surely index it in the search engines by making a anchor tag with the reference starting with a #! . try it it might help but i m not sure about your perticular problem.

share|improve this answer
2  
I would agree that this JavaScript content could be indexed. However, #! (hashbang) URLs are for indexing pages that are dynamically loaded using AJAX, that would not otherwise have a canonical URL. It is not necessary for indexing arbitrary content that is rendered with JavaScript which would seem to be the case in question. –  w3d Sep 22 '12 at 18:31
add comment

Search engines do not parse javascript so document.write() would not be indexed by search engines. One way you might be able to get around this is by having text in noscript tags.

Example:

<noscript>Text goes here</noscript>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.