Presentation is loading. Please wait.

Presentation is loading. Please wait.

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..

Similar presentations


Presentation on theme: "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.."— Presentation transcript:

1 PHP and AJAX

2 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.

3 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 Q2 2007 (http://www.thinkbroadband.com/news/3280-number-of-uk-broadband-users-nearing-saturation-point.html)

4 Clients and Servers Browsers now run JavaScript in a more predictable manner. So the technology is ready for AJAX but what is it?

5 What isn't AJAX A Language A Technology A Plug-in Proprietary All that hard The answer to all of our dreams

6 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.

7 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.” http://coldfusion.sys-con.com/read/138966.htm http://coldfusion.sys-con.com/read/138966.htm Ajax has become synonymous with any rich web application or Web 2.0 / 3.0 application.

8 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();

9 Demos Image Editor Text Stuff Google Suggests Google Maps

10 Some tutorials http://www.w3schools.com/php/php_ajax_datab ase.asp http://www.w3schools.com/php/php_ajax_datab ase.asp http://www.ibm.com/developerworks/xml/library/ os-php-rad1/ http://www.ibm.com/developerworks/xml/library/ os-php-rad1/ http://www.phpbuilder.com/columns/kassemi200 50606.php3 http://www.phpbuilder.com/columns/kassemi200 50606.php3 http://www.phpbuilder.com/columns/kassemi200 50606.php3 http://www.phpbuilder.com/columns/kassemi200 50606.php3 http://www.johnwiseman.ca/blogging/tutorials/cre ating-a-mysql-connection-with-phpajax/ http://www.johnwiseman.ca/blogging/tutorials/cre ating-a-mysql-connection-with-phpajax/

11 Links – Further Reading http://dhtmlnirvana.com/ajax/ajax_tutorial/ http://ajaxpatterns.org/wiki/index.php?title= Whats_Ajax http://ajaxpatterns.org/wiki/index.php?title= Whats_Ajax http://www.maxkiesler.com/index.php/webl og/comments/round_up_of_50_ajax_toolki ts_and_frameworks/ http://www.maxkiesler.com/index.php/webl og/comments/round_up_of_50_ajax_toolki ts_and_frameworks/ http://www.ajaxwith.com/PHP http://www.fiftyfoureleven.com/resources/p rogramming/xmlhttprequest/examples http://www.fiftyfoureleven.com/resources/p rogramming/xmlhttprequest/examples


Download ppt "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.."

Similar presentations


Ads by Google