Xmlhttprequest Object=1 Material Heavily Borrowed from Apple

Xmlhttprequest Object=1 Material Heavily Borrowed from Apple

XMLHttpRequest Object1 Jonathan Geisler April 14, 2008 1Material heavily borrowed from Apple Jonathan Geisler XMLHttpRequest History Microsoft had the foresight to create a way for a web page to contact a server without having to refresh the page. Initially, it was an ActiveX object. Other browser developers (Mozilla, Safari, Opera, Konqueror, etc.) noticed and copied with a cross platform solution. And all the world rejoiced! Jonathan Geisler XMLHttpRequest Creating the Object For native support: var reqObj = new XMLHttpRequest(); For ActiveX support: var reqObj = new ActiveXObject("Microsoft.XMLHTTP"); Jonathan Geisler XMLHttpRequest Creating the Object portably Use a portability framework (e.g., Sarissa), or: var reqObj ; if (window.XMLHttpRequest) { reqObj = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { reqObj = new ActiveXObject("Msxml2.XMLHTTP"); } catch (err) { reqObj = new ActiveXObject("Microsoft.XMLHTTP"); } } Jonathan Geisler XMLHttpRequest Methods The object contains the following methods: abort() getAllResponseHeaders() getResponseHeader() open() send() setRequestHeader() Jonathan Geisler XMLHttpRequest Properties The object contains the following properties: onreadystatechange readyState responseText responseXML status statusText Jonathan Geisler XMLHttpRequest open() This function takes up to 5 parameters: 1 method 2 URL 3 asyncFlag = true 4 userName 5 password Jonathan Geisler XMLHttpRequest readyState The state can have the following values: 0 = uninitialized 1 = loading 2 = loaded 3 = interactive 4 = complete Jonathan Geisler XMLHttpRequest Security To keep people from writing effective phishing attacks where they have a web site that borrows the look from one web site, but sends submitted data to a malicious site, most browsers will limit the object from contacting any site other than the site the containing page came from. This severely limits how you can tie a page together with services from a bunch of various sources. Oh well . Jonathan Geisler XMLHttpRequest.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    9 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us