项目作者: madflow

项目描述 :
Just another another (another) url slug creation plugin for jQuery.
高级语言: JavaScript
项目地址: git://github.com/madflow/jquery-slugify.git
创建时间: 2013-05-14T20:34:59Z
项目社区:https://github.com/madflow/jquery-slugify

开源协议:MIT License

下载


Build Status

jQuery Slugify

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

Getting Started

You can install the plugin using Bower:

  1. bower install jquery-slugify

You can install the plugin using NPM:

  1. npm install jquery-slugify --save

You can install the plugin using YARN:

  1. yarn add jquery-slugify

You can download the production version or the development version.

The plugin depends on speakingurl.

In your web page:

  1. <script src="jquery.js"></script>
  2. <script src="speakingurl.min.js"></script>
  3. <script src="slugify.min.js"></script>
  4. <input type ="text" value="" id="slug-source" /> <!-- The text to be slugged -->
  5. <input type ="text" value="" id="slug-target" /> <!-- The processed text as slug -->
  6. <script>
  7. jQuery(function($) {
  8. $.slugify("Ätschi Bätschi"); // "aetschi-baetschi"
  9. $('#slug-target').slugify('#slug-source'); // Type as you slug
  10. $("#slug-target").slugify("#slug-source", {
  11. separator: '_' // If you want to change separator from hyphen (-) to underscore (_).
  12. });
  13. });
  14. </script>