<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Converting a string to slug with JavaScript</title>
	<atom:link href="http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/</link>
	<description>How am I supposed to know?? Ask Pipo!</description>
	<lastBuildDate>Mon, 30 Jan 2012 17:56:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Flavia</title>
		<link>http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/#comment-12582</link>
		<dc:creator>Flavia</dc:creator>
		<pubDate>Wed, 31 Aug 2011 15:52:15 +0000</pubDate>
		<guid isPermaLink="false">http://dense13.com/?p=72#comment-12582</guid>
		<description>Thank you so much for this, I was going mad to achieve exactly this
result in sanitizing a string (but didn&#039;t succeed of course...).
You saved my day :) Muchissimas gracias!! Flavia</description>
		<content:encoded><![CDATA[<p>Thank you so much for this, I was going mad to achieve exactly this<br />
result in sanitizing a string (but didn't succeed of course...).<br />
You saved my day :) Muchissimas gracias!! Flavia</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wiseman</title>
		<link>http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/#comment-11987</link>
		<dc:creator>Wiseman</dc:creator>
		<pubDate>Tue, 09 Aug 2011 10:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://dense13.com/?p=72#comment-11987</guid>
		<description>Thanks a lot! Nice snippet</description>
		<content:encoded><![CDATA[<p>Thanks a lot! Nice snippet</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dense13</title>
		<link>http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/#comment-3975</link>
		<dc:creator>dense13</dc:creator>
		<pubDate>Tue, 18 Jan 2011 04:03:51 +0000</pubDate>
		<guid isPermaLink="false">http://dense13.com/?p=72#comment-3975</guid>
		<description>@DOgi: sorry, the polish characters got all messed up. Feel free to email me (blog AT dense13 DOT com), and I&#039;ll fix it.

Edit: Mmh, not easy, I can&#039;t just add them here, some of the characters you sent still get ignored (not sure if it&#039;s a WordPress or a browser issue). I&#039;ll try to sort that out.</description>
		<content:encoded><![CDATA[<p>@DOgi: sorry, the polish characters got all messed up. Feel free to email me (blog AT dense13 DOT com), and I'll fix it.</p>
<p>Edit: Mmh, not easy, I can't just add them here, some of the characters you sent still get ignored (not sure if it's a WordPress or a browser issue). I'll try to sort that out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DOgi</title>
		<link>http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/#comment-3961</link>
		<dc:creator>DOgi</dc:creator>
		<pubDate>Mon, 17 Jan 2011 15:25:35 +0000</pubDate>
		<guid isPermaLink="false">http://dense13.com/?p=72#comment-3961</guid>
		<description>Polish language support added: &lt;code&gt;var from =
&quot;àáäâèéëêìíïîòóöôùúüûñç·/_,:;??????ó??&quot;; var to =
&quot;aaaaeeeeiiiioooouuuunc------aceslnozz&quot;;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Polish language support added: <code>var from =<br />
"àáäâèéëêìíïîòóöôùúüûñç·/_,:;??????ó??"; var to =<br />
"aaaaeeeeiiiioooouuuunc------aceslnozz";</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dense13</title>
		<link>http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/#comment-1905</link>
		<dc:creator>dense13</dc:creator>
		<pubDate>Wed, 24 Nov 2010 02:02:47 +0000</pubDate>
		<guid isPermaLink="false">http://dense13.com/?p=72#comment-1905</guid>
		<description>@Paulius: found it! The problem wasn&#039;t the RegExp, but the square bracket notation for strings. Now it works, with:

&lt;code&gt;str = str.replace(new RegExp(from.charAt(i), &#039;g&#039;), to.charAt(i));&lt;/code&gt;

Maybe you were already suggesting that, since your comment got cut half-way through.</description>
		<content:encoded><![CDATA[<p>@Paulius: found it! The problem wasn't the RegExp, but the square bracket notation for strings. Now it works, with:</p>
<p><code>str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));</code></p>
<p>Maybe you were already suggesting that, since your comment got cut half-way through.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dense13</title>
		<link>http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/#comment-1900</link>
		<dc:creator>dense13</dc:creator>
		<pubDate>Tue, 23 Nov 2010 23:23:52 +0000</pubDate>
		<guid isPermaLink="false">http://dense13.com/?p=72#comment-1900</guid>
		<description>@Paulius: in fact it crashes both IE6 and IE7 (but not IE8). Here&#039;s the code I&#039;m using:

&lt;code&gt;slug = slug.replace(new RegExp(from[i], &#039;g&#039;), to[i]);&lt;/code&gt;

Maybe there is a more efficient way to do this? Is this definitely an IE bug?

Btw, sorry for the lack of proper formatting in comments, I know it&#039;s annoying. It works well when I post comments though, another thing to look at...</description>
		<content:encoded><![CDATA[<p>@Paulius: in fact it crashes both IE6 and IE7 (but not IE8). Here's the code I'm using:</p>
<p><code>slug = slug.replace(new RegExp(from[i], 'g'), to[i]);</code></p>
<p>Maybe there is a more efficient way to do this? Is this definitely an IE bug?</p>
<p>Btw, sorry for the lack of proper formatting in comments, I know it's annoying. It works well when I post comments though, another thing to look at...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dense13</title>
		<link>http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/#comment-1899</link>
		<dc:creator>dense13</dc:creator>
		<pubDate>Tue, 23 Nov 2010 23:07:53 +0000</pubDate>
		<guid isPermaLink="false">http://dense13.com/?p=72#comment-1899</guid>
		<description>@Paulius: you&#039;re absolutely right, gotta fix that. The problem is that using a RegExp crashes IE6 (see comment 6 - it was a good reason after all).</description>
		<content:encoded><![CDATA[<p>@Paulius: you're absolutely right, gotta fix that. The problem is that using a RegExp crashes IE6 (see comment 6 - it was a good reason after all).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paulius</title>
		<link>http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/#comment-1888</link>
		<dc:creator>Paulius</dc:creator>
		<pubDate>Tue, 23 Nov 2010 12:30:32 +0000</pubDate>
		<guid isPermaLink="false">http://dense13.com/?p=72#comment-1888</guid>
		<description>This script does not replace repetitive non-latin letters, i.e.:
xxxààà wil become xxxa because of str.replace behaviour You should
use RegExp object to replace these strings globally: for (var i=0,
l=from.length ; i</description>
		<content:encoded><![CDATA[<p>This script does not replace repetitive non-latin letters, i.e.:<br />
xxxààà wil become xxxa because of str.replace behaviour You should<br />
use RegExp object to replace these strings globally: for (var i=0,<br />
l=from.length ; i</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dense13</title>
		<link>http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/#comment-944</link>
		<dc:creator>dense13</dc:creator>
		<pubDate>Mon, 04 Oct 2010 07:40:18 +0000</pubDate>
		<guid isPermaLink="false">http://dense13.com/?p=72#comment-944</guid>
		<description>Hey, thanks to myself for writing this, now I can reuse it in my current Rails project. :)</description>
		<content:encoded><![CDATA[<p>Hey, thanks to myself for writing this, now I can reuse it in my current Rails project. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dense13</title>
		<link>http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/#comment-937</link>
		<dc:creator>dense13</dc:creator>
		<pubDate>Sat, 18 Sep 2010 01:54:05 +0000</pubDate>
		<guid isPermaLink="false">http://dense13.com/?p=72#comment-937</guid>
		<description>@Thomas Lopes: actually, you can&#039;t do that, it will crash IE6/7 (see comment #2 by David Prek). In fact that was my first version of the script, but later got rid of the regular expression (see comment #6, btw thanks to Pat Allan for the fix). Another consideration is that Regexp replacement might be less efficient (although in this case that probably wouldn&#039;t be a problem, this is not likely to be a function that&#039;s executed repeatedly).

But your comment made think about the function, and I&#039;ve made it a bit more compact (post has been updated): now it doesn&#039;t need to replace upper and lower case characters.</description>
		<content:encoded><![CDATA[<p>@Thomas Lopes: actually, you can't do that, it will crash IE6/7 (see comment #2 by David Prek). In fact that was my first version of the script, but later got rid of the regular expression (see comment #6, btw thanks to Pat Allan for the fix). Another consideration is that Regexp replacement might be less efficient (although in this case that probably wouldn't be a problem, this is not likely to be a function that's executed repeatedly).</p>
<p>But your comment made think about the function, and I've made it a bit more compact (post has been updated): now it doesn't need to replace upper and lower case characters.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

