且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

动态加载网页内容

更新时间:2023-12-05 10:05:34

AJAX 请求与普通的 HTTP 请求非常相似.因此,您无需以任何特殊方式配置服务器即可使其工作.通常的服务器至少应该已经支持 GET 和 POST 请求.

AJAX requests are very much like usual HTTP requests. So you do not need to configure your server in any special way to make them work. A usual server should already support at least GET and POST requests.

但是,对您来说可能很重要的一件事是,只要文件没有其他保护",每个人也可以直接访问它们.因此,如果 AJAX 加载的内容包含某种用户敏感数据,您应该设置一些访问控制!

One thing, that might be important for you, however, is, that as long as there is no other "protection" for the files, everyone can access them directly, too. So in case the AJAX-loaded content contains some kind of user sensitive data, you should put some access control in place!