开发者

Retain Site Background and Switch Pages?

I was about to redo a Rails site today using AJAX so that the background could remain in place. Then I thought, "that would开发者_Python百科 be exactly like using frames," and then I thought about SEO consequences and I dropped the idea entirely and took a look around the Web. It turns out that few sites -- except for Google itself, which has the link bar at the top -- are doing this. It doesn't look impossible to do, but it's not exactly easy. Aside from Ajaxing, you have to think about updating the query-string and having SEO-friendly links (that actually don't work, but rather make background requests via Javascript).

Will any of the new technologies -- HTML5, perhaps -- solve this problem and allow us to have a Web with background colors (and other static elements) that do not disappear momentarily between page refreshes?

On the other hand, why are few devs doing this with current technologies? Is it just not a big deal, too complicated to implement, or....?


This is really a browser issue. Some browsers may show the flash of white, but some don't change anything until there is something to display on the next page.

You could use AJAX, with a normal link structure as backup. So you'd link to, say, page2.html, but have an onclick event tied to the <a> tag that uses AJAX to fetch the relevant content. The function needs to returns false to stop the normal link activating. That way the site is still accessible for non-JS users, and SEO-friendly, but avoids the white-flash problem.

However, I honestly don't think it's much of a problem. There are billions of web pages with non-white backgrounds and users are used to this effect happening in their browser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜