You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2009/05/15 13:50:22 UTC

svn commit: r775093 - /myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js

Author: werpu
Date: Fri May 15 11:50:21 2009
New Revision: 775093

URL: http://svn.apache.org/viewvc?rev=775093&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-2114 added a few comments



Modified:
    myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js

Modified: myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js?rev=775093&r1=775092&r2=775093&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js (original)
+++ myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxUtils.js Fri May 15 11:50:21 2009
@@ -114,6 +114,13 @@
         }
     }
 
+    /**
+     * encapsulated xhr object which tracks down various implementations
+     * of the xhr object in a browser independend fashion
+     * (ie pre 7 used to have non standard implementations because
+     * the xhr object standard came after IE had implemented it first
+     * newer ie versions adhere to the standard and all other new browsers do anyway)
+     */
     myfaces._impl.xhrCore._AjaxUtils.prototype.getXHRObject = function() {
         if('undefined' != typeof XMLHttpRequest && null != XMLHttpRequest) {
             return new XMLHttpRequest();
@@ -128,13 +135,17 @@
     }
 
 
+    /**
+     * loads a script and executes it under a global scope
+     * @param {String} src the source to be loaded
+     * @param {String} type the mime type of the script (currently ignored
+     * but in the long run it will be used)
+     */
     myfaces._impl.xhrCore._AjaxUtils.prototype.loadScript = function(src, type) {
         var xhr = this.getXHRObject();
         xhr.open("GET", src, false);
         xhr.send(null);
 
-
-
         //since we are synchronous we do it after not with onReadyStateChange
         if(xhr.readyState == 4) {
             if (xhr.status == 200) {