applications/luci-ahcp: javascript fix
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 25 Sep 2011 20:52:26 +0000 (20:52 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 25 Sep 2011 20:52:26 +0000 (20:52 +0000)
applications/luci-ahcp/luasrc/view/ahcp_status.htm

index bc595ce6c8e59cf2ec4099286b757e1668a8b4dd..f9ac7c3b04ba1dca20fde756bcab1c1b4ea2e122 100644 (file)
@@ -1,6 +1,8 @@
 <script type="text/javascript">//<![CDATA[
        var stxhr = new XHR();
-       var update_status = function() {
+       (function() {
+               var func = arguments.callee;
+
                stxhr.get('<%=luci.dispatcher.build_url("admin", "network", "ahcpd", "status")%>', null,
                        function(x, st)
                        {
                                                tx.innerHTML = String.format('The AHCP Service is running with ID %s.', st.uid);
                                }
 
-                               window.setTimeout(update_status, 5000);
+                               window.setTimeout(func, 5000);
                        }
                )
-       };
-
-       update_status();
+       })();
 //]]></script>
 
 <fieldset class="cbi-section">