window.location = 'http://...';
now I want to assign this location path to a variable, as a normal text string. I want to achieve:
var Path = 'http://...';
i tried to use:
var Path = window.location;
but I get, as this var value:
function Path() { [native code] }
while I want to have the location text string as its value..
You want location.href
. The location
object is rather more complicated than a simple string.
This should work (though I didn't test):
var path = window.location.href;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With