From aef848f16ee01eb3a8552cfb5398a398335c6e4b Mon Sep 17 00:00:00 2001 From: tomchiverton Date: Fri, 9 Aug 2013 15:40:57 +0100 Subject: [PATCH] Make the JSON url a variable setable when the board is created --- js/solari.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/solari.js b/js/solari.js index 4811cf0..cd09562 100644 --- a/js/solari.js +++ b/js/solari.js @@ -70,6 +70,8 @@ var solariData; var current_board = []; var new_board = []; +var postUrl='../example/postJson.py'; + //an attempt to reduce slowdown from animations jQuery.fx.interval = 20; @@ -81,7 +83,9 @@ function ToUpper(code) { } //constructs the solariBoard within the given div. If no parameter is given, adds the board to "body" -function addSolariBoard(divSelector) { +function addSolariBoard(divSelector,url) { + postUrl=url || postUrl; + if (solari_setup_done === 1) { return; } @@ -318,7 +322,7 @@ function GetFailBoard() { } function updateSolariBoard() { - $.post('../example/postJson.py', //replace this with your own script + $.post(postUrl, function (data) { if (data !== null) { solariData = data.slice(0);