When users want effects to happen between page loads (ie, old content fades out then new content back in), I typically build the site as follows:
index.php, about.php, etc…
<?php if(@$_SERVER['HTTP_X_REQUESTED_WITH']==''){include('includes/header.php');}?>
<content>blah blah blah</content>
<?php if(@$_SERVER['HTTP_X_REQUESTED_WITH']==''){include('includes/footer.php');}?>
this way, if Javascript is enabled, I can dynamically load the content and do whatever effect is desired, but the page still function if the jscript is disabled.
When I do this, though, is it possible to dynamically load meta tags/titles as well? ie:
<?php if(@$_SERVER['HTTP_X_REQUESTED_WITH']==''){include('includes/header-top.php');}?>
<meta http-equiv='description' content='stufffffff'>
<title>Page | ABOUT</title>
<?php if(@$_SERVER['HTTP_X_REQUESTED_WITH']==''){include('includes/header-bottom.php');}?>
<content>blah blah blah</content>
<?php if(@$_SERVER['HTTP_X_REQUESTED_WITH']==''){include('includes/footer.php');}?>
Is there any way to replace the title/meta tags with the jquery ‘load’ function? If I just want to replace .copy with the new .copy, I can do $(‘.copy’).load($url+’ .copy’), but is there any way to do this with the title and meta tags as well?
Also, if you have any suggestions on alternative methods here (if I’m going about this all wrong), please offer suggestions. Thanks!
I have recently just completed the major work for a site that does much of what you’re trying to do.
I use the HIJAX technique, which is similiar to what you are doing. The major SEO concern is that your site be accessible with full titles, and meta keys, WITHOUT JAVASCRIPT. That is the way web spiders (google, bing, yahoo, et al) will crawl your site.
to make the site dynamic for visitors, I recommend embedding a hidden span inside of the content that is returned via ajax. Inside of this span, include the page title using PHP. then use javascript to get the content of that span, and set the document.title to it.
Summary: