Location.href is giving partial url
On a page URL like :
Using will return
(it stops at the '&'
is there a way to get the full URL including '...&cntnt01articleid=3&cntnt01returnid=15'
I cannot change the URL as it is generated by my CMS.
yup, i think you have to use var myurl = urlencode(location.href), somethign to that effect, this will convert the & and ? into friendly characters
The commas are not valid for the value mact ! You have probably to use a
"http:mysite.com/index.php?mact"+encodeURIComponent("News,cntnt01,detail,0") for this value with special characters.
NB : You have not to decode this value with PHP (See the Warning in the middle of on this page)
Last edited by 007Julien; 06-21-2012 at 06:52 PM.
location.href returns whole url, output it to console or just type in chrome/firebug console location.href you might have display problems if you attempt to display it unencoded since & might be interpreted as special char begining (i.e. non breakable space)
maurycy is correct, you can read all about the location object here. some of the characters in the url may be interpreted as html when you try to alert/write out the url to the screen, but it is all there.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread