- Web Penetration Testing with Kali Linux(Third Edition)
- Gilberto Najera Gutierrez Juned Ahmed Ansari
- 397字
- 2021-06-24 18:44:55
Building blocks of AJAX
As mentioned previously, AJAX is a mixture of the common web technologies that are used to build a web application. The way the application is designed using these web technologies results in an AJAX-based application. The following are the components of AJAX:
- JavaScript: The most important component of an AJAX-based application is the client-side JavaScript code. The JavaScript interacts with the web server in the background and processes the information before being displayed to the user. It uses the XMLHttpRequest (XHR) API to transfer data between the server and the client. XHR exists in the background, and the user is unaware of its existence.
- Dynamic HTML (DHTML): Once the data is retrieved from the server and processed by the JavaScript, the elements of the web page need to be updated to reflect the response from the server. A perfect example would be when you enter a username while filling out an online form. The form is dynamically updated to reflect and inform the user if the username is already registered on the website. Using DHTML and JavaScript, you can update the page contents on the fly. DHTML was in existence long before AJAX. The major drawback of only using DHTML is that it is heavily dependent on the client-side code to update the page. Most of the time, you do not have everything loaded on the client side and you need to interact with the server-side code. This is where AJAX comes into play by creating a connection between the client-side code and the server-side code via the XHR objects. Before AJAX, you had to use JavaScript applets.
- Document Object Model (DOM): A DOM is a framework used to organize elements in an HTML or XML document. It is a convention for representing and interacting with HTML objects. Logically, imagine that an HTML document is parsed as a tree, where each element is seen as a tree node and each node of the tree has its own attributes and events. For example, the body object of the HTML document will have a specific set of attributes such as text, link, bgcolor, and so on. Each object also has events. This model allows an interface for JavaScript to access and update the contents of the page dynamically using DHTML. DHTML is a browser function, and DOM acts as an interface to achieve it.
推薦閱讀
- 零起點學Linux系統(tǒng)管理
- 從零開始寫Linux內(nèi)核:一書學透核心原理與實現(xiàn)
- Alfresco 4 Enterprise Content Management Implementation
- 奔跑吧 Linux內(nèi)核(入門篇)
- 深入理解eBPF與可觀測性
- Mobile First Design with HTML5 and CSS3
- Kali Linux 2018:Windows Penetration Testing
- Delphi Programming Projects
- Red Hat Enterprise Linux 6.4網(wǎng)絡操作系統(tǒng)詳解
- AWS SysOps Cookbook
- Vim 8文本處理實戰(zhàn)
- 每天5分鐘玩轉Docker容器技術
- Hadoop Operations and Cluster Management Cookbook
- Getting Started with Citrix XenApp 6.5
- Apache ShardingSphere權威指南