Welcome to WebmasterWorld Guest from 188.8.131.52
Forum Moderators: open
This seems to work fine in IE6.0 and Opera, but NN7 and Firefox don't encode the & (it does not make a difference whether location.href is in single quotes or double quotes) Instead, the browser address line shows:
On the other hand, this works fine in all browsers:
Major websites (ie., view the page source on Google) still use the latter method.. even though it is not technically HTML 4.01 valid!
Parenthetically, it's easy to get URL-encoded values by just typing something like the following in your browser's location window:
For example, I noticed that when I search in Google for "encoding & ampersand", then the resulting URL in the browser address bar is something like:
Ony the non-delimiting ampersand (and semi-colon) has been encoded. The page source for that Google search still shows that delimiting ampersands are NOT encoded.