在不刷新整个页面的情况下更新网页上元素的显示 [英] Updating display of elements on the web page without refreshing the whole page

查看:77
本文介绍了在不刷新整个页面的情况下更新网页上元素的显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上次我编写Web应用程序的代码大约是10年前.我曾经使用过Java/JSP/HTML/CSS等.从那时起,我就一直在编写非Web应用程序的代码.

Last time I coded a web application was almost 10 years ago. I used Java/JSP/HTML/CSS etc. I've been coding non-web applications only ever since.

当我现在浏览现代站点(如本站点)时,我意识到我的Web开发技能已过时.也许我现在不知道如何实现的最明显的功能"是用户输入后在页面上的元素更新,而不必刷新整个页面(例如,此处的投票/否决投票将更新投票计数而无需重新加载整个页面)页).背后的基本技术是什么?

When I look at modern sites now (like this one), I realize how my web development skills are obsolete. Maybe the most obvious "feature" that I wouldn't know how to implement now is the update of elements on the page after user input without having to refresh the whole page (e.g. the voting/downvoting here updates the vote count without reloading the whole page). What are the basic technologies behind this?

推荐答案

该技术归于

Ajax(异步JavaScript和XML的简写)是一组相互关联的Web开发技术,用于客户端以创建交互式Web应用程序.使用Ajax,Web应用程序可以在后台异步地从服务器检索数据,而不会影响现有页面的显示和行为. Ajax技术的使用导致网页上交互式或动态界面的增加.通常使用XMLHttpRequest对象检索数据.尽管有名称,实际上并不需要使用XML,也不需要异步请求.

Ajax (shorthand for asynchronous JavaScript and XML) is a group of interrelated web development techniques used on the client-side to create interactive web applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. The use of Ajax techniques has led to an increase in interactive or dynamic interfaces on web pages. Data is usually retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not actually required, nor do the requests need to be asynchronous.

这篇关于在不刷新整个页面的情况下更新网页上元素的显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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