最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - How to update some part of the webpage? - Stack Overflow

programmeradmin1浏览0评论

I would like to update (change the content) some part of the webpage without updating the whole page (without refreshing the page). Of course first thing you would write as an answer will be "Ajax!!!", but I know that search engines will not be able to get the content of that part if I do with Ajax.

So is there any method or workaround to update page partly still remaining that part visible to the search engines?

I would like to update (change the content) some part of the webpage without updating the whole page (without refreshing the page). Of course first thing you would write as an answer will be "Ajax!!!", but I know that search engines will not be able to get the content of that part if I do with Ajax.

So is there any method or workaround to update page partly still remaining that part visible to the search engines?

Share Improve this question edited Nov 6, 2009 at 14:21 Narek asked Nov 6, 2009 at 14:00 NarekNarek 40k86 gold badges245 silver badges399 bronze badges 4
  • You're trying to update the text dynamically and have it indexed by a search engine? Are you planning to update the page permanently? If it's just a dynamic query you're wanting to display dynamically you can always load it on the page but hide it with visibility or display and toggle the visibility as needed. Could you clarify what you're trying to achieve overall though? – thismat Commented Nov 6, 2009 at 14:08
  • Let's say I have 7 tab buttones on my website, and under that buttons I have the content of the page (something like stackowerflow.). So I want to update the half of the bottom part, because the other half is hardcoded text. – Narek Commented Nov 6, 2009 at 14:12
  • 1 If you want that indexed you're going to have to preload all the content and use javascript to modify the visibility/display state of the items. I've seen this done before even on web standard guru's sites (hicksdesign.co.uk is one example), so it's not really a horrible practice, though I don't think it's a very clean solution. – thismat Commented Nov 6, 2009 at 14:16
  • Consensus is clear! I should load everything but show part by part with JS! Thanks! – Narek Commented Nov 6, 2009 at 14:20
Add a ment  | 

3 Answers 3

Reset to default 6

yes.. it is possible by not using ajax ;)

what you can do is load all content that is necessary for displaying. When the page is fully loaded you hide the content that should not be visible at startup. This can be done by CSS or javascript. When the content should be loaded by pressing a button you can alter the css property (with javascript) of the element so it is visible

In short: No.

The moment you start breaking the "One URL" = "One Page" principle, you alienate search engines (and bookmarkers, and people who want to send a link to a friend).

The other main option is frames (which replaces "invisible to search engines" with "orphan pages").

A third option is stuffing all the content on to the page in the first place, and then using JS to set class names on elements to hide some content.

In general, sharing duplicate meta-content (navigation etc) between pages is the cleanest, simplest, most reliable approach.

I would put in normal links to normal pages and have javascript replace the link with the ajax link.

That way you are also providing for the people who have javascript disabled.

发布评论

评论列表(0)

  1. 暂无评论