Why not just using ajax for Page Requests to load the page content?

后端 未结 9 912
醉话见心
醉话见心 2021-01-13 07:47

Many web pages load all of their content to change very little information.

Now I would like to know why shouldn\'t the developers just use ajax for the main page re

9条回答
  •  孤城傲影
    2021-01-13 08:09

    Well if you want to AJAX load new pages, such as the same way Gmail works, I suggest your links are normal A HREF links that point to a true full rendering page URL and alos use an onclick event that stop the attempt at normal link loading and make your AJAX calls. The problem here is you'll be doing almost double coding unless you architecture this all very well.

    This way the normal non JS links load the full page, and the JS calls only load the new parts or page. This means spider indexing works again too.

提交回复
热议问题