Popular JavaScript recipes tagged "url"http://code.activestate.com/recipes/langs/javascript/tags/url/2011-07-12T17:46:49-07:00ActiveState Code Recipesslugify: make a string usable in a URL or filename (JavaScript)
2011-07-12T17:46:49-07:00Trent Mickhttp://code.activestate.com/recipes/users/4173505/http://code.activestate.com/recipes/577787-slugify-make-a-string-usable-in-a-url-or-filename/
<p style="color: grey">
JavaScript
recipe 577787
by <a href="/recipes/users/4173505/">Trent Mick</a>
(<a href="/recipes/tags/filename/">filename</a>, <a href="/recipes/tags/nodejs/">nodejs</a>, <a href="/recipes/tags/slug/">slug</a>, <a href="/recipes/tags/slugify/">slugify</a>, <a href="/recipes/tags/url/">url</a>).
Revision 2.
</p>
<p>"Slugify" a string so it has only alphanumeric and hyphen characters. Useful for URLs and filenames. This is a JavaScript (node.js too) version of <a href="http://code.activestate.com/recipes/577257/">Recipe 577257</a>.</p>
<p>Note: It is missing the guarantee that only ascii characters are passed through. I don't know an NFKD equivalent in JavaScript-land.</p>
Random URL (JavaScript)
2010-03-25T16:07:54-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577143-random-url/
<p style="color: grey">
JavaScript
recipe 577143
by <a href="/recipes/users/4172570/">FB36</a>
(<a href="/recipes/tags/random/">random</a>, <a href="/recipes/tags/url/">url</a>).
</p>
<p>Save this code as randomURL.html.
Everytime you open the file w/ a browser it will try to visit a random Internet page.
Unfortunately most random trials does not take you a browser renderable webpage.
I am open to ideas on how to make certain it finds a good webpage everytime.</p>