From 260771ff25c3c599caab846115fd3b2fa65cda9c Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Wed, 9 Sep 2015 18:31:04 +0200 Subject: [PATCH] http: table: fix dataURI (I don't think this'll be the last time..) --- wdocs/table/index.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wdocs/table/index.html b/wdocs/table/index.html index af13608..d07c2f1 100644 --- a/wdocs/table/index.html +++ b/wdocs/table/index.html @@ -72,8 +72,18 @@ function getuserlist() { + var dataURI = location.protocol + "//" + location.host; + + var parts = location.pathname.split('/'); + for (var i = 1; i < parts.length - 2; i++) { + dataURI = dataURI + "/" + parts[i]; + } + dataURI = dataURI + "/api/0/last" + location.search; + + console.log("dataURI = " + dataURI); + $.ajax({ - url: "http://127.0.0.1:8084/api/0/last", // "getlast.php", + url: dataURI, type: "GET", dataType: 'json', success: function(data) {