TAG_ADDプラグイン

Hi%username%
ブログの投稿を追加するフォームを作成する必要がありました。 標準フィールド(名前、日付、テキストなど)に加えて、タグを追加するために使用可能なフォームをねじ込む必要がありました。
なぜなら 私はjQueryでコーディングしているので、選択は明確でした。
私が自分のために設定した必要なタスクは次のとおりです。
  1. 設定が簡単
  2. すべてのタグは1つのファイル(キャッシュ内)に保存されます
  3. サーバーとクライアントの最小負荷
  4. タグのリスト-ヒントは、特定のタグの選択されたリクエストに対してのみ開かれます。


プラグインの詳細には触れません。

接続-標準:


  1. < head > < meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" > < title > TAG_ADD. jQuery Plugin </ title > < script type ="text/javascript" src ="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" ></ script > <script type= "text/javascript" src= "tag_add_js/tag_add.js" > </ script > < link rel ="stylesheet" type ="text/css" href ="tag_add_css/tag_add.css"> </ head >
  2. < head > < meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" > < title > TAG_ADD. jQuery Plugin </ title > < script type ="text/javascript" src ="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" ></ script > <script type= "text/javascript" src= "tag_add_js/tag_add.js" > </ script > < link rel ="stylesheet" type ="text/css" href ="tag_add_css/tag_add.css"> </ head >
  3. < head > < meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" > < title > TAG_ADD. jQuery Plugin </ title > < script type ="text/javascript" src ="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" ></ script > <script type= "text/javascript" src= "tag_add_js/tag_add.js" > </ script > < link rel ="stylesheet" type ="text/css" href ="tag_add_css/tag_add.css"> </ head >
  4. < head > < meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" > < title > TAG_ADD. jQuery Plugin </ title > < script type ="text/javascript" src ="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" ></ script > <script type= "text/javascript" src= "tag_add_js/tag_add.js" > </ script > < link rel ="stylesheet" type ="text/css" href ="tag_add_css/tag_add.css"> </ head >
  5. < head > < meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" > < title > TAG_ADD. jQuery Plugin </ title > < script type ="text/javascript" src ="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" ></ script > <script type= "text/javascript" src= "tag_add_js/tag_add.js" > </ script > < link rel ="stylesheet" type ="text/css" href ="tag_add_css/tag_add.css"> </ head >
  6. < head > < meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" > < title > TAG_ADD. jQuery Plugin </ title > < script type ="text/javascript" src ="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" ></ script > <script type= "text/javascript" src= "tag_add_js/tag_add.js" > </ script > < link rel ="stylesheet" type ="text/css" href ="tag_add_css/tag_add.css"> </ head >
  7. < head > < meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" > < title > TAG_ADD. jQuery Plugin </ title > < script type ="text/javascript" src ="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" ></ script > <script type= "text/javascript" src= "tag_add_js/tag_add.js" > </ script > < link rel ="stylesheet" type ="text/css" href ="tag_add_css/tag_add.css"> </ head >
*このソースコードは、 ソースコードハイライターで強調表示されました。

フォームを描画してプラグインを呼び出す



<input type= "text" name= "tag_input" id= "tag_input_id" >
<br>
<em>( )</em></p>

<script>
jQuery( document ).ready( function (){
$( "#tag_input_id" ).tag_add();
})
</script>


* This source code was highlighted with Source Code Highlighter .


設定できます


  1. <script>
  2. jQuery( document ).ready( function (){
  3. $( "#tag_input_id2" ).tag_add({
  4.     
  5. maxitem :0, // . -
  6. minlength :2, // . -
  7. maxlength :10, // . -
  8. loadinfo : 'loadtag.php' , //
  9.  
  10. });
  11. })
  12. })
  13. </script>

* This source code was highlighted with Source Code Highlighter .
これがプラグイン全体です。デモはここで見ることができます
使用))


Source: https://habr.com/ru/post/J66125/


All Articles