Thursday, July 7, 2011

create slug using stringToSlug jQuery Plugin

hello mydevelovers.
I was confusing how to create a permalink for realtime, I was search on google and i found this plugin.

creating permalink using stringToSlug plugin is very easy. you just need jquery dan stringToSlug plugin

next create HTML:
<blockquote>
<h4>Demo</h4>
<input id="string" size="50" type="text" value="Altere o texto deste campo." />
<strong>Preview:</strong> <span id="permalink" style="color: #880000;">sdkuaghf-s-d98-sdsd-2-fsdjf-sdfnk</span></blockquote>


next create Javascript:
$(document).ready( function() {
$("#title").stringToSlug({
setEvents: 'keyup keydown blur',
getPut: '#permalink',
space: '-'
});
});


try your self, this is the manual