I am using following code to display the contents of one of a remote website using Jquery/Ajax.
The code works great, the problem is when i do View-Source in Browser the actual contents are not diplayed. Just the Jquery code is displayed. So what i want to do is When i View-source in browser the actual content should be displayed as well keeping SEO in mind.
Is this possible ?
<script type="text/javascript" language="javascript">
$(document).ready(function() {
var directoryName = 'anthropology';
$.ajax({
type: 'GET',
url: "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fd4426411.u92.gohsphere.com%2F%22%20and%20xpath%3D%22%2F%2Fdiv%5B%40id%3D'page'%5D%22",
dataType: 'html',
success: function(data) {
$(data).find('a').attr('href', function(_, href) {
return href.replace('http://d4426411.u92.gohsphere.com/', 'http://www.abc.com/blog/default.htm/')
}).end().appendTo('#content_area');
}
});
});
</script>
</head>
<body>
<div id="space"><br /></div>
<div id="content_area">
</div>