1

I'm using this plugin called TagHandler. Link: http://ioncache.github.io/Tag-Handler/ May I know how can I assign tags from the database and not hard code to jquery? Example, to assign tags is

$("#array_tag_handler").tagHandler({
    assignedTags: [ 'C', 'Perl', 'PHP' ],
    availableTags: [ 'C', 'C++', 'C#', 'Java', 'Perl', 'PHP', 'Python' ],
    autocomplete: true
});

But I want it from mysql database.

They only gave example for available tags which is using the getData buildin function

$("#ajaxget_tag_handler").tagHandler({
    getData: { id: 'user123', type: 'user' },
    getURL: '/ajaxtest/get',
    autocomplete: true
});

I need the php example. I don't know how to retrieve data in JSON format.

From the website..."By supplying a "getURL" for the tags to be retrieved via AJAX. When using this method, the server must supply a JSON formatted array named "availableTags" and optionally an additional array named "assignedTags"."

4

1 に答える 1