Ajax. Introduction
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Ajax. Introduction

on

  • 753 views

Introduction to ajax

Introduction to ajax

Statistics

Views

Total Views
753
Views on SlideShare
748
Embed Views
5

Actions

Likes
0
Downloads
6
Comments
0

1 Embed 5

http://www.slideshare.net 5

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Ajax. Introduction Presentation Transcript

  • 1. Ajax Основы Алексей Бованенко
  • 2. Объект • ActiveXObject(“Microsoft.XMLHTTP”) • XMLHttpRequest
  • 3. Создание XMLHTTP объекта • try{ xmlhttp=new XMLHttpRequest(); }catch(e){ var xmlarray=new Array("MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"); for(var i=0;i<xmlarray.length;++i){ try{ xmlhttp=new ActiveXObject(xmlarray[i]); }catch(e){}}}
  • 4. Отправка запроса • try{ xmlhttp.open("GET","http://localhost/~alexei/test/getdata.php? d="+text,true); xmlhttp.onreadystatechange=handler1; xmlhttp.send(null); }catch(e){ alert("send failed"); }
  • 5. Получение данных • if(xmlhttp.readyState==4){ if(xmlhttp.status==200){ try{ var response=xmlhttp.responseText; d.innerHTML=response; }catch(e){ alert("answer failed"); } } }
  • 6. Конец Спасибо за внимание e-mail: a.bovanenko@gmail.com