Character substitution on Jquery

Here an easy way to search and replace each occurrence a group of characters (in this case underscore and minus) with another (in this case a space) on a specified element (in this case each A), using Jquery javascript library.

The first argument passed on replace is a regex, if you just pass a single character (like “\_” or “-“) only first occurrence for each element.

regex

Real world usage: I use this onto a long page, where a table has long filenames with underscore and minus in place of spaces. This trick allows in my case to show tables nicely, without caring on a mass substitution via server side scripting.

See also:

https://web.archive.org/web/20090704000000*/http://en.wikipedia.org/wiki/Regex

https://web.archive.org/web/20090704000000*/http://evolt.org/regexp_in_javascript

https://web.archive.org/web/20090704000000*/http://docs.jquery.com/Utilities/jQuery.each

https://web.archive.org/web/20090704000000*/http://docs.jquery.com/Attributes/html

Proxied content from gemini://chirale.org/2009-07-04_352.gmi (external content)

Gemini request details:

Original URL
gemini://chirale.org/2009-07-04_352.gmi
Status code
Success
Meta
text/gemini; charset=utf-8
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.