jquery-slugify

Just another another (another) url slug creation plugin for jQuery.

Download as .zip Download as .tar.gz View on GitHub

Just another another (another) url slug creation plugin for jQuery.

Getting Started

Download the production version or the development version.

The plugin depends on speakingurl.

In your web page:

<script src="jquery.js"></script>
<script src="speakingurl.min.js"></script>
<script src="slugify.min.js"></script>

<input type ="text" value="" id="slug-source" /> <!-- The text to be slugged -->
<input type ="text" value="" id="slug-target" /> <!-- The processed text as slug -->

<script>
jQuery(function($) {
  $.slugify("Ätschi Bätschi"); // "aetschi-baetschi"
  $('#slug-target').slugify('#slug-source'); // Type as you slug

  $('#slug-target-1').slugify('#slug-source-1', {
    separator: '_' // If you want to change separator from hypen (-) to underscore (_) 
  }); 

});
</script>

Demo


 

Demo with Custom Separator