PHP and AJAX
Servers and Clients For many years we tried to move as much as possible to the server. Weak clients, poor bandwidth, browser compatibility.. Created a certain way of interacting with a website. Request – Response model.
Clients and Servers Client machines have become much more powerful. You’re not using much of your duel core processor rendering a webpage Bandwidth has increased dramatically 9.5 million broadband users in the UK (2006, BBC) “Broadband now makes up 57.4% of all net connections compared to 42.6% for dial-up. In the last year dial-up connections had shrunk by 28.7%” (2005, BBC) 14,520,988 Q (
Clients and Servers Browsers now run JavaScript in a more predictable manner. So the technology is ready for AJAX but what is it?
What isn't AJAX A Language A Technology A Plug-in Proprietary All that hard The answer to all of our dreams
What is AJAX? Asynchronous JavaScript and XML What is asynchronous? Uses JavaScript and XML to create seamless interaction on a website. Lots of CSS sites look ‘real purty’ but still have the response/request model of interaction. Using Obvious forms for their interaction.
AJAX “It uses the JavaScript XMLHttpRequest function to create a tunnel from the client's browser to the server and transmit information back and forth without having to refresh the page.” Ajax has become synonymous with any rich web application or Web 2.0 / 3.0 application.
PHP and Ajax XMLHttpRequest Object “XMLHttpRequest (XHR) is an API that can be used by JavaScript, and other web browser scripting languages to transfer XML and other text data to and from a web server using HTTP, by establishing an independent communication channel between a web page's Client-Side and Server-Side.” - Wiki Created in IE: var AlsAjaxObject = new ActiveXObject("Microsoft.XMLHTTP"); In other browsers: var AlsAjaxObject = new XMLHttpRequest();
Demos Image Editor Text Stuff Google Suggests Google Maps
Some tutorials ase.asp ase.asp os-php-rad1/ os-php-rad1/ php php php php3 ating-a-mysql-connection-with-phpajax/ ating-a-mysql-connection-with-phpajax/
Links – Further Reading Whats_Ajax Whats_Ajax og/comments/round_up_of_50_ajax_toolki ts_and_frameworks/ og/comments/round_up_of_50_ajax_toolki ts_and_frameworks/ rogramming/xmlhttprequest/examples rogramming/xmlhttprequest/examples