Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- var tagsElem = $("#tags");
- tagsElem.autocomplete({
- source : "search.php",
- search : function( event, ui ){
- if(check(response,tagsElem.val()))
- response[response.length]=tagsElem.val()
- tagsElem.autocomplete( "option", "source", response);
- },
- open: function( event, ui ) {
- if(check(response,tagsElem.val())){
- tagsElem.next().find('li:last a').append(' <span style="color:red;">new</span>');
- }
- }
- });
- function check(arrayTag,value){
- for(i=0;i<len;i++){
- if( arrayTag[i]==value)
- return false
- }
- return true
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement