From 13c06a283089c85e682097eb0ecb17a86df805a0 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Wed, 7 Apr 2010 17:28:48 +0100 Subject: Add support for IE --- index.html | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index 43ed8e2..74b5462 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ untitled + @@ -19,7 +20,11 @@ url: url, dataType: 'text', beforeSend: function(request) { - request.overrideMimeType('text/plain; charset=x-user-defined'); + try { + request.overrideMimeType('text/plain; charset=x-user-defined'); + } catch(e) { + // IE doesn't support overrideMimeType + } }, success: function(data) { try { @@ -29,6 +34,13 @@ } }, error: function(xhr, textStatus, errorThrown) { + // Special case for IE which handles binary data slightly + // differently. + if(textStatus == 'parsererror') { + if (typeof xhr.responseBody != 'undefined') { + return this.success(xhr.responseBody); + } + } d.errback(new Error(xhr.status)); } }); @@ -55,8 +67,7 @@ jQuery.each(results, function(i, result) { rrd = result[1]; - var series = rrdRRA2FlotObj(result[1], 5, [0, 1], 1, 1); - console.log(series); + var series = rrdRRA2FlotObj(rrd, 3, [0, 1], 1, 1); data = data.concat(series.data); }); @@ -70,7 +81,7 @@ function(failure) { err = failure; - $('.container').text('error: ' + err); + $('.container').text('error: ' + failure.message); }); }); -- cgit v1.2.3-2-g168b