From 11bef01ac46d5f57a97f2a1e28cac1c11c0425cd Mon Sep 17 00:00:00 2001 From: Julian Steinwachs Date: Mon, 23 Feb 2015 15:16:29 +0100 Subject: [PATCH] Fixing #224 - twister in subdir --- js/twister_io.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/twister_io.js b/js/twister_io.js index 9e91c99..4d36fc4 100644 --- a/js/twister_io.js +++ b/js/twister_io.js @@ -10,7 +10,7 @@ function twisterRpc(method, params, resultFunc, resultArg, errorFunc, errorArg) { // removing hardcoded username from javascript: please use url http://user:pwd@localhost:28332 instead //var foo = new $.JsonRpcClient({ ajaxUrl: '/', username: 'user', password: 'pwd'}); - var foo = new $.JsonRpcClient({ ajaxUrl: '/' }); + var foo = new $.JsonRpcClient({ ajaxUrl: window.location.pathname.replace(/[^\/]*$/, '') }); foo.call(method, params, function(ret) { resultFunc(resultArg, ret); }, function(ret) { if(ret != null) errorFunc(errorArg, ret); }