From 66a637815e28cca5ef664ee5da8886a5284077e9 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Mon, 27 Dec 2010 12:45:23 -0500 Subject: [PATCH] utils.js: separate attr and id I was using the attribute as the object id in the html page. By splitting the two, I can have the same attribute set in multiple places on a single page independently. --- html/index.html | 6 +++--- html/utils.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/html/index.html b/html/index.html index 768cae4d..596b8236 100644 --- a/html/index.html +++ b/html/index.html @@ -8,12 +8,12 @@ Library Browser Library Browser 2 Remote Controls - + diff --git a/html/utils.js b/html/utils.js index 03f86a41..3d650759 100644 --- a/html/utils.js +++ b/html/utils.js @@ -1,19 +1,19 @@ // Bryan Schumaker (12 / 27 / 2010) -function set_attr(attr) +function set_attr(attr, id) { var req = new XMLHttpRequest(); req.onreadystatechange = function() { if (req.readyState == 4 && req.status == 200) { - document.getElementById(attr).innerHTML = req.responseText; + document.getElementById(id).innerHTML = req.responseText; } } req.open('GET', "controls.py?a=" + attr, true) req.send() - setTimeout("set_attr(\"" + attr + "\")", 3000) + setTimeout("set_attr(\"" + attr + "\", \"" + id + "\")", 3000) } function do_request(action)