rem:  if (batch.verb == "GET" || navigator.userAgent.indexOf('Safari') >= 0) { 
add:  var indexSafari = navigator.userAgent.indexOf('Safari/'); if (indexSafari >= 0) {  var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) { batch.verb == "GET"; } } if (batch.verb == "GET") { 
context: DWREngine._sendData = function(batch) {  // If the batch is empty, don't send anything  if (batch.map.callCount == 0) return;  // Call any pre-hooks  if (batch.preHook) batch.preHook();  // Set a timeout  if (batch.metadata && batch.metadata.timeout && batch.metadata.timeout != 0) {    var funcReq = function() { DWREngine._abortRequest(batch); };    setTimeout(funcReq, batch.metadata.timeout);  }  // A quick string to help people that use web log analysers  var statsInfo;  if (batch.map.callCount == 1) {    statsInfo = batch.map["c0-scriptName"] + "." + batch.map["c0-methodName"];  }  else {    statsInfo = "Multiple." + batch.map.callCount;  }  // Get setup for XMLHttpRequest if possible  if (batch.method == DWREngine.XMLHttpRequest) {    if (window.XMLHttpRequest) {      batch.req = new XMLHttpRequest();    }    // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used    else if (window.ActiveXObject && !(navigator.userAgent.indexOf('Mac') >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) {      batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP);    }  }  var query = "";  var prop;  if (batch.req) {    batch.map.xml = "true";    // Proceed using XMLHttpRequest    batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); };    // Force Mac people to use GET because Safari is broken.    if (batch.verb == "GET" || navigator.userAgent.indexOf('Safari') >= 0) {      // Some browsers (Opera/Safari2) seem to fail to convert the value      // of batch.map.callCount to a string in the loop below so we do it      // manually here.      batch.map.callCount = "" + batch.map.callCount;      for (prop in batch.map) {        var qkey = encodeURIComponent(prop);        var qval = encodeURIComponent(batch.map[prop]);        if (qval == "") {          if (DWREngine._warningHandler) {            DWREngine._warningHandler("Found empty qval for qkey=" + qkey);          }        }        query += qkey + "=" + qval + "&";      }      query = query.substring(0, query.length - 1);      try {        batch.req.open("GET", batch.path + "/exec/" + statsInfo + "?" + query, batch.asynchronous);        batch.req.send(null);      }      catch (ex) {        DWREngine._handleMetaDataError(batch.metadata, ex);      }    }    else {      for (prop in batch.map) {        if (typeof batch.map[prop] != "function") {          query += prop + "=" + batch.map[prop] + "\n";        }      }      try {        // This might include Safari too, but it shouldn't do any harm//        if (navigator.userAgent.indexOf('Gecko') >= 0) {//          batch.req.setRequestHeader('Connection', 'close');//        }        batch.req.open("POST", batch.path + "/exec/" + statsInfo, batch.asynchronous);        batch.req.send(query);      }      catch (ex) {        DWREngine._handleMetaDataError(batch.metadata, ex);      }    }  }  else {    batch.map.xml = "false";    var idname = "dwr-if-" + batch.map["c0-id"];    // Proceed using iframe    batch.div = document.createElement('div');    batch.div.innerHTML = "<iframe frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>";    document.body.appendChild(batch.div);    batch.iframe = document.getElementById(idname);    batch.iframe.setAttribute('style', 'width:0px; height:0px; border:0px;');    if (batch.verb == "GET") {      for (prop in batch.map) {        query += encodeURIComponent(prop) + "=" + encodeURIComponent(batch.map[prop]) + "&";      }      query = query.substring(0, query.length - 1);      batch.iframe.setAttribute('src', batch.path + "/exec/" + statsInfo + "?" + query);      document.body.appendChild(batch.iframe);    }    else {      batch.form = document.createElement('form');      batch.form.setAttribute('id', 'dwr-form');      batch.form.setAttribute('action', batch.path + "/exec" + statsInfo);      batch.form.setAttribute('target', idname);      batch.form.target = idname;      batch.form.setAttribute('method', 'post');      for (prop in batch.map) {        var formInput = document.createElement('input');        formInput.setAttribute('type', 'hidden');        formInput.setAttribute('name', prop);        formInput.setAttribute('value', batch.map[prop]);        batch.form.appendChild(formInput);      }      document.body.appendChild(batch.form);      batch.form.submit();    }  }};
meta: 266	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/266/86af0f13e4cb26e450b47fb0d38ea25994763c7f/engine.js/clean/java/uk/ltd/getahead/dwr/engine.js