Sha256: cd0e17faf0034fe7d5797fb5622e7a72a499a3244ff322df3872b220ee77ab4a

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

//Socket descriptor, each new socket should increment *before* using it
var if_net_request_socket_index = 0

//A basic get request that supports callbacks
if_net_req = function(verb, url, params, tp_base) {
  $.ajax({
    url: url,
    method: verb,
    data: params,
    dataType: "json",
    success: function(data, textStatus, xhr) {
      int_dispatch([3, "int_net_cb", tp_base, xhr.status, data]);
    },
  error: function(xhr, textStatus, err) {
    int_dispatch([3, "int_net_cb", tp_base, -1, textStatus]);
  }
})
}

//A basic get request that supports callbacks
if_net_req2 = function(verb, headers, url, params, tp_base) {
  $.ajax({
    url: url,
    method: verb,
    data: params,
    beforeSend: function (xhr) {
      for (var name in headers) {
        var value = headers[name];
        xhr.setRequestHeader(name, value);
      }
    },
    success: function(data, textStatus, xhr) {
      int_dispatch([3, "int_net_cb", tp_base, xhr.status, data]);
    },
  error: function(xhr, textStatus, err) {
    int_dispatch([3, "int_net_cb", tp_base, -1, textStatus]);
  }
})
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flok-0.0.105 app/drivers/chrome/src/net.js