diff --git a/src/js/ux/AdvancedSearch.js b/src/js/ux/AdvancedSearch.js index 99ef32a..c785835 100644 --- a/src/js/ux/AdvancedSearch.js +++ b/src/js/ux/AdvancedSearch.js @@ -749,9 +749,9 @@ ogrid.AdvancedSearch = ogrid.Class.extend({ //register with browser history if (query.geoFilter && query.geoFilter.boundary === '_map-extent') { - hasher.setHash("query?q=" + JSON.stringify(query).replace('#', encodeURIComponent('#')) + "&loc=" + this._getMapLocation() + "&run=" + autoexec + randomData); + hasher.setHash("query?q=" + JSON.stringify(query).replace(/#/g, encodeURIComponent('#')) + "&loc=" + this._getMapLocation() + "&run=" + autoexec + randomData); } else { - hasher.setHash("query?q=" + JSON.stringify(query).replace('#', encodeURIComponent('#')) + "&run=" + autoexec + randomData); + hasher.setHash("query?q=" + JSON.stringify(query).replace(/#/g, encodeURIComponent('#')) + "&run=" + autoexec + randomData); } }, diff --git a/src/js/ux/Main.js b/src/js/ux/Main.js index 0060af1..bfc3803 100644 --- a/src/js/ux/Main.js +++ b/src/js/ux/Main.js @@ -75,8 +75,10 @@ ogrid.Main = ogrid.Class.extend({ } console.log(o); - //#issue 115; replace hash here or we'll get an error - o.q = o.q.replace(encodeURIComponent('#'), "#"); + var regex = new RegExp(encodeURIComponent('#'),'g'); + + //#issue 115; replace hash here or we'll get an error + o.q = o.q.replace(regex, '#'); me._loadQuery( o.q,