1 / 11

PHP and AJAX

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.

ownah
Download Presentation

PHP and AJAX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 • 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_database.asp • http://www.ibm.com/developerworks/xml/library/os-php-rad1/ • http://www.phpbuilder.com/columns/kassemi20050606.php3 • http://www.phpbuilder.com/columns/kassemi20050606.php3 • http://www.johnwiseman.ca/blogging/tutorials/creating-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://www.maxkiesler.com/index.php/weblog/comments/round_up_of_50_ajax_toolkits_and_frameworks/ • http://www.ajaxwith.com/PHP • http://www.fiftyfoureleven.com/resources/programming/xmlhttprequest/examples

More Related