]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/browse.js
Use querystring, stop manually building urls
[rails.git] / app / assets / javascripts / browse.js
index e21cbd67206a068ce803a0c7bfe1923293b7ad9d..4edee5952664d3fd1ab6adef034275e2c568a5c2 100644 (file)
@@ -9,9 +9,21 @@ $(document).ready(function () {
     $("#linkloader").load(function () { loaded = true; });
 
     if (select) {
-      $("#linkloader").attr("src", "http://127.0.0.1:8111/load_and_zoom?left=" + left + "&top=" + top + "&right=" + right + "&bottom=" + bottom + "&select=" + select);
+      $("#linkloader").attr("src", "http://127.0.0.1:8111/load_and_zoom?" +
+        querystring.stringify({
+            left: left,
+            top: top,
+            right: right,
+            bottom: bottom,
+            select: select
+        }));
     } else {
-      $("#linkloader").attr("src", "http://127.0.0.1:8111/load_and_zoom?left=" + left + "&top=" + top + "&right=" + right + "&bottom=" + bottom);
+      $("#linkloader").attr("src", "http://127.0.0.1:8111/load_and_zoom?" + querystring.stringify({
+            left: left,
+            top: top,
+            right: right,
+            bottom: bottom
+        }));
     }
 
     setTimeout(function () {