unmeshm
asked on
innerHTML set using Javascript is not visible on View Page Source
I am generating dynamic pages on my site using innerHTML (see example below).
<html>
<head>
<script type="text/javascript">
function load() {
document.getElementById("c ontent").i nnerHTML=" New Content";
}
</script>
</head>
<body onload="load();">
<div id="content">Old content</div>
</body>
</html>
When I do a "View-Page Source" on the browser (both IE and Firefox), I was expecting to see:
<div id="content">New Content</div>
but instead I see:
<div id="content">Old Content</div>
The Page on the browser, though, display "New Content" correctly. Only the View-PageSource is the problem. Any idea on how to do this so that the "View-PageSource" shows the changed content?
The reason, I ask is because I am expecting Search Engine bots to visit the dynamic pages and if the content that gets displayed to the bots is not the "new content" then my dynamic pages are useless.
Any other way of doing this would also be appreciated.
<html>
<head>
<script type="text/javascript">
function load() {
document.getElementById("c
}
</script>
</head>
<body onload="load();">
<div id="content">Old content</div>
</body>
</html>
When I do a "View-Page Source" on the browser (both IE and Firefox), I was expecting to see:
<div id="content">New Content</div>
but instead I see:
<div id="content">Old Content</div>
The Page on the browser, though, display "New Content" correctly. Only the View-PageSource is the problem. Any idea on how to do this so that the "View-PageSource" shows the changed content?
The reason, I ask is because I am expecting Search Engine bots to visit the dynamic pages and if the content that gets displayed to the bots is not the "new content" then my dynamic pages are useless.
Any other way of doing this would also be appreciated.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mplungian: here is an example URL from my site: http://www.sadakmap.com/p/Cafe-Coffee-Day/
As you can see, when this URL is opened, other neighborhood places show up on the sidebar and they have embedded links in them that I wanted the bot to visit and index. I am filling up the sidebar using Javascript (setting innerHTML). I will look into setting this on the server side.
As you can see, when this URL is opened, other neighborhood places show up on the sidebar and they have embedded links in them that I wanted the bot to visit and index. I am filling up the sidebar using Javascript (setting innerHTML). I will look into setting this on the server side.
Ahh.
Yes if you do not want to gamble that google follows ajax data, you can put the links in a nice table in a <noscript></noscript> tag
I seem to have read something about the danger of sniffing the bot and serve google prechewed pages...
Yes if you do not want to gamble that google follows ajax data, you can put the links in a nice table in a <noscript></noscript> tag
I seem to have read something about the danger of sniffing the bot and serve google prechewed pages...
ASKER