开发者

What are the advantages and disadvantages of a web site that contains a single page? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 5 years ago.

Improve this question 开发者_JAVA百科

I would like to code a little web site that will contain several sections like "Home", "Gallery", "Contact Us", "FAQs", and so on.

I thought to do this in one HTML by putting each section in a div and show only one div per time (using Javascript / jQuery), based on the chosen menu button.

Alternatively, I could create a separate HTML page per section, and link these pages to the menu buttons.

What are the advantages and disadvantages of these two methods ?


The first method means longer loading times since you have to load everything on the site up front, and it's totally broken for people who have disabled Javascript or whose browsers don't support it. The second method means the user only has to load the content they are actually looking at, and it should work even with non-Javascript browsers.


The main disadvantages that comes to mind for the first method are:

  • Poor SEO: Google will only see your home page as Google bot doesn't execute javascript.
  • Back/Forward buttons won't work.
  • Takes longer time to load initially.
  • As site becomes bigger, it'd need more memory and might slow down the browser and even the machine


The advantage of the method would be speed, when navigating you don't need a round-trip to the server.

It also has a couple of disadvantages the main ones are; You can only link to the front-page, not directly to for example the about page because it doesn't have a separate url.

The back button in the user's browser won't work anymore.


The Advantages of the Javascript solution are mainly that you dont need to reload the page which is very nice for the user.

On the other hand you have the visitors with javascript disabled who wont be able to load the different pages. Also you cannot navigate over Javascript pages with the browser's back and forth buttons.

The last thing I see is that your code could become messy if you're not very careful and organized.


SEO for one thing - Googlebot will likely only ever index the home page, and your other pages will be effectively invisible to search engines.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜