i have long wondered how search engine read the content of the page. Is it the script page which it sees Or Is it the final html page which it sees
http://www.webconfs.com/search-engine-spider-simulator.php Use this tool to see how the spider sees your site.
search engine spiders are getting a copy of your page sourse (html codes) . because of this using javascript may be a problem for the web pages
They also check with screenshot to find if text is visible or not, h1 with style etc. But i believe that is very resource consuming and it will work randomly and once in a while only.