动态加载网页内容 [英] Dynamically load web-page content

查看:29
本文介绍了动态加载网页内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个必须即时构建内容的网页.当用户点击网页的某些部分时,它必须将与网页放在同一目录中的服务器上的文件中的信息加载到特殊内容

I have a web-page which content must be constructed on the fly. When user clicks some parts of the web-page, it must load information from the file which is placed on the server in the same directory along with web-page into special content <div>.

中.>

据我所知,使用JavaScript,我必须使用ajax技术,所以我有一个问题:我应该配置服务器以便他可以专门处理ajax请求,还是只是应该支持的简单的GET over HTTP请求还是通过任何网络服务器?

As far as I get it, with JavaScript, I must use ajax technology so I have a question: should I configure server so that he can handle ajax requests specifically, or is it just simple GET over HTTP request which should be supported by any web-server anyway?

我的第二个问题 - 如果 ajax 是一种技术,只有在正确配置服务器的情况下才会起作用,我可以通过简单的 GET 从 JavaScript 以某种方式做我需要的吗?

And my second question - if ajax is technology, which will work out only if server is properly configurated, can I do what I need by simple GET from JavaScript somehow?

另外,如果使用服务器端脚本更容易,那么 VBScript 怎么做?

Also, if it is easier to use server-side scripting, how can it be done by VBScript?

推荐答案

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!

这篇关于动态加载网页内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆