How to do "strtolower", "str_replace" and "preg_replace" in javascript?
<p>How can I do this in javascript?</p>

<pre><code>$name = $xml-&gt;name;
$file_name = strtolower($name);
$file_name = str_replace(array('-','  ',' ','å','ä','ö'), array('',' ','-','a','a','o'), $file_name);
$file_name = preg_replace("/[^a-z0-9-]+/i", "", $file_name);
</code></pre>
