For some reason it does not work. The error message I get is: s.split is not a function
Thank you all for your comments so far.
Yes, you are right. I AM missing a dot there. But that is not the problem. Good eye.
I am pretty sure we can use regular expressions.(http://www.webreference.com/js/column5/methods.html).
The script you wrote works fine.
I also fixed my own code (with a little help from a frined).
We added a space at the end of the url, when assigning to a var and it worked.
var current_url = document.location;
var current_url = document.location + ” “;
Now I wonder why? Any thoughts on that?
why not try what i said?
both document.location.href and document.location.toString() works document.location+””
will convert document.location “toString()” automaticly