导航不同页面而不重新加载

时间:2017-04-06 12:30:27

标签: html

我是网络开发的菜鸟,我对网站的链接有疑问。我在某个网站上发现点击导航中的链接页面没有重新加载,内容也发生了变化。

一个很好的例子就是这个网站本身。当您打开此网站即stackoverflow.com并点击导航链接上的任何其他链接时,如果点击问题链接,则网址会更改为stackoverflow.com/questions。在我的网页中,它首先显示index.html,然后点击导航中的“关于我们”链接,它会显示另一个网址aboutus.html

这与动态网页有关吗?有人可以帮忙吗?此外,stackoverflow.com不会显示.html之类的扩展名。请帮我理解这个。谢谢你,你有责任回答。

1 个答案:

答案 0 :(得分:0)

That is because of url routing, routing can be done from server side as well as on client side.You can also learn about SPA(Single page application).Visit here.

Basically, in case of server side page rendering.The server matches target url with a certain set of url rules specified by the developer and sends back a particular file.

When routing is done on client side,the routing rules are defined on clientside javascript.You can also read about 'routing using angularjs' or 'routing using reactjs'.Almost all the javascipt framework support url routing these day.

Hope, this clears your doubt.

Thank you