[Project_owners] & and ®l in links/uri's
caugusti at formatvorlage.de
Tue Sep 6 19:36:50 EDT 2005
your question isn't really clear... what exactly are you trying to do?
You can use the & inside HTML links, as it's replaced by & during
parsing, so you can use both to separate key/value pairs inside the
query string. In XHTML/XML you have to use the entity version anyways.
If you want to send an ampersand as part of a key's value and not to
separate key/value pairs, you need to do URI encoding, which is done by
escapeURIComponent("Barnes&Noble"), which is the Unicode-safe version.
However, the regex to replace & by & is:
text = "foo=bar&bar=baz";
text = text.replace( /&/g, "&" );
Michael Vincent wrote:
> Is is allowed to have stuff like & and @reg; in links?
> Also, what regex do I need to replace & in & in links, and when
> can that somehow fail? Are there special edge cases to watch out for?
> Has anyone ever done something like this before for one of their
> Aha, I smell food :-) food food food :-)
> Project_owners mailing list
> Project_owners at mozdev.org
More information about the Project_owners