AJAX + SEO快速的问题 [英] AJAX + SEO quick question

查看:110
本文介绍了AJAX + SEO快速的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户希望效果的页面加载之间发生(即旧的内容淡出,然后新的内容回),我通常建立网站如下:

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,等等...

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');}?>

这样一来,如果启动Javascript,我可以动态加载的内容和做任何作用的话,但网页仍然起作用,如果JScript是禁用的。

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.

当我这样做,虽然是可以动态加载meta标签/标题呢?即:

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');}?>

有没有什么办法,以取代与jQuery的加载功能的标题/ meta标签?如果我只是想用新的.copy更换.copy,我可以做$('拷贝')。载荷($网址+'.copy),但有什么办法与标题和meta标签,这样做好?

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.

我用的是HIJAX技术,它类同你在做什么。主要的搜索引擎优化的问题是,你的网站会以饱满的标题和Meta键,没有JavaScript访问。这是路网蜘蛛(谷歌,必应,雅虎等)会抓取你的网站。

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.

使网站动态游客,我建议嵌入一个隐藏的范围通过AJAX返回的内容里面。在这个范围的,使用PHP包括网页标题。然后使用JavaScript来获取范围的内容,并设置document.title时给它。

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.

摘要:

  1. 使网站功能,无需JavaScript的
  2. 添加AJAX到hijax链接
  3. 插入一个隐藏的DOM节点返回的AJAX内容在
  4. 解析隐藏的节点是在阿贾克斯成功的标题,并设置document.title时给它。

这篇关于AJAX + SEO快速的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆