xhr.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*******************************************************************************
  2. * Copyright (c) 2009, 2011 IBM Corporation and others.
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * http://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors:
  9. * IBM Corporation - initial API and implementation
  10. ******************************************************************************
  11. *
  12. * Based on information from https://developer.mozilla.org/En/XMLHttpRequest
  13. * and http://msdn2.microsoft.com/en-us/library/ms533062.aspx
  14. **/
  15. /**
  16. * function createRequest
  17. * @type XMLHttpRequest
  18. * @memberOf Window
  19. */
  20. Window.prototype.createRequest= function(){return new XMLHttpRequest();};
  21. /**
  22. * Object XMLHttpRequest
  23. * @type constructor
  24. */
  25. XMLHttpRequest.prototype=new Object();
  26. function XMLHttpRequest(){};
  27. /**
  28. * function onreadystatechange
  29. * @memberOf XMLHttpRequest
  30. */
  31. XMLHttpRequest.prototype.onreadystatechange=function(){};
  32. /**
  33. * property readyState
  34. * @type Number
  35. * @memberOf XMLHttpRequest
  36. */
  37. XMLHttpRequest.prototype.readyState=0;
  38. /**
  39. * property responseText
  40. * @type String
  41. * @memberOf XMLHttpRequest
  42. */
  43. XMLHttpRequest.prototype.responseText="";
  44. /**
  45. * property responseXML
  46. * @type Document
  47. * @memberOf XMLHttpRequest
  48. */
  49. XMLHttpRequest.prototype.responseXML=new Document();
  50. /**
  51. * property status
  52. * @type Number
  53. * @memberOf XMLHttpRequest
  54. */
  55. XMLHttpRequest.prototype.status=0;
  56. /**
  57. * property statusText
  58. * @type String
  59. * @memberOf XMLHttpRequest
  60. */
  61. XMLHttpRequest.prototype.statusText="";
  62. /**
  63. * function abort()
  64. * @memberOf XMLHttpRequest
  65. */
  66. XMLHttpRequest.prototype.abort=function(){};
  67. /**
  68. * function getAllResponseHeaders()
  69. * @type String
  70. * @memberOf XMLHttpRequest
  71. */
  72. XMLHttpRequest.prototype.getAllResponseHeaders=function(){return "";};
  73. /**
  74. * function open(method, url, async, username, password)
  75. * @param {String} method
  76. * @param {String} url
  77. * @param {Boolean} optional async
  78. * @param {String} optional username
  79. * @param {String} optional password
  80. * @memberOf XMLHttpRequest
  81. */
  82. XMLHttpRequest.prototype.open=function(method, url, async, username, password){};
  83. /**
  84. * function send(body)
  85. * @param {Object} body
  86. * @memberOf XMLHttpRequest
  87. */
  88. XMLHttpRequest.prototype.send=function(body){};
  89. /**
  90. * function setRequestHeader(header,value)
  91. * @param {String} header
  92. * @param {String} value
  93. * @memberOf XMLHttpRequest
  94. */
  95. XMLHttpRequest.prototype.setRequestHeader=function(header,value){};
  96. /**
  97. * function getAllResponseHeaders()
  98. * @param {String} header
  99. * @type String
  100. * @memberOf XMLHttpRequest
  101. */
  102. XMLHttpRequest.prototype.getResponseHeader=function(header){return "";};