(“wpsl-search-btn”).click(); map doesn’t focus
-
Hi, thanks for this great plugin. But I am having an issue with custom javascript on the map.
I have created a textbox on navbar and it takes the parameter and runs this “document.getElementById(“wpsl-search-btn”).click();”
It lists the stores but map keep showing all stores(it doesn’t focus I guess?). How can I reload map too?
Below is my javascript to send parameters and click;
<script type="text/javascript"> function getParameterByName(name, url) { if (!url) { url = window.location.href; } name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } var foo = getParameterByName('location_box'); if (foo != null){ window.onload=function(){ document.getElementById('wpsl-search-input').value=foo; document.getElementById("wpsl-search-btn").click(); } } </script>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘(“wpsl-search-btn”).click(); map doesn’t focus’ is closed to new replies.