Unable To Get Value Of Get Parameter In Url With #
Solution 1:
That URL makes no sense. You need to have the query string before the fragment:
abc.com/new.php?val=100#tabs-11
Stuff after #
is not parsed as part of the URL by the server. It may not even be sent by the browser.
Solution 2:
#tabs-11?val=100
would be considered an Anchor for the in this instance. Make sure that you put your Anchors at the end of the query string
Solution 3:
When a url has a "#" in it, that points to a "named anchor", or a "fragment". It isn't part of the "GET" variables... So, you can't get it that way. In fact, the server doesn't even know anything about it.
Since you tagged this with jquery as well, javascript can actually do that.
var url = window.location.href;
This will give you the full url. From there, you can just search for substrings.
var anchor = url.substring(url.indexOf("#"));
var gets = anchor.substring(anchor.indexOf("?"));
Although, I would like to point out that your url is incorrect. The anchor should go after the get variables.
Post a Comment for "Unable To Get Value Of Get Parameter In Url With #"