I am able to get the querystring from url like this using regex and javascript: But I need to get rid of these %22...these don't show up in IE, just in FF..How do I do that? Ineeed everything after k=..but without %22..
<script type="text/javascript">document.write('<div class="DynamicSearchTitle">
Showing All Results For ' +
location.href.match(/\&k\=(.+)/)[1]+ ' Matches </div>');
</script>
URL
2 Answers 2
The URL is broken so I can't take a look at the whole code, but I think what you're looking for is the decodeURI-function.
decodeURI("%22")
for example would return "
Unescapeing the url from your question:
decodeURI("&k=%22Hospital%22%20OR%20%22Office%22");
returns &k="Hospital" OR "Office"
1 Comment
You can get all the Query String component by simple JS function described here
Use it like this,
var uparts = getUrlParts(location.href);
var the_K = uparts["k"];
Comments
Explore related questions
See similar questions with these tags.
location.search
.