slugIt! is a tiny but feature-rich jQuery slug generator for producing readable and Search engine marketing-friendly URL slugs from any strings.
Options:
- Replaces areas and undesirable chars with customized separators.
- Trims main/trailing separators.
- Eliminates repeated separatos.
- Converts uppercase to lowercase.
- Helps European utf8 chars: Latin, Greek, Turkish, Russian, Ukranian, Czech, Polish, and Latvian.
- Helps forex symbols like €, $, £, and so on.
- Helps particular characters like ©, (c), ∆, and so on.
- Permits you to create your personal character mappings.
See Additionally:
How To Use It:
1. Obtain and import the jQuery slugIt plugin.
<script src="/path/to/cdn/jquery.slim.min.js"></script> <script src="/path/to/jquery.slugit.js"></script>
2. Name the plugin on the goal enter discipline.
<enter sort="textual content" id="enter" worth="I really like jQueryScript"> <enter sort="textual content" class="output" readonly />
$(perform(){ $('#enter').slugIt({ output: '.output', // default: '#slug' }); });
3. Override the default separator (-).
$(perform(){ $('#enter').slugIt({ separator: '_', }); });
4. Override the default set off occasions.
$(perform(){ $('#enter').slugIt({ occasions: 'keypress keyup', }); });
5. Add your personal character mappings.
$(perform(){ $('#enter').slugIt({ map: { '*': 'star' } }); });
6. Callback features.
$(perform(){ $('#enter').slugIt({ earlier than: perform(textual content){ // ... } after: perform(slug){ // ... } }); });
This superior jQuery plugin is developed by diegok. For extra Superior Usages, please test the demo web page or go to the official web site.