I creat the list by:
function creattags() {
$(document).ready(function() {
function creattags(event) {
event.preventDefault();
$.getJSON("json/tags.json", function(data) {
var html = '';
html +='
'
$.each(data, function(entryIndex, entry) {
html += '
' + entry.tags + '
';
});
html +='
'
$('#tagwarp1').html(html);
})
}
creattags(event);
});
}
creattags();
My data is:
[
{"id": "0", "tags": "t1"},{"id": "1", "tags": "t2"}, {"id": "2", "tags": "t3"}
];
I get the result like this.
t1
t2
t3
Tagit doesn't work on this list creat by tags.json, but it works on the list creat by the data in my js.
How can I sholve this problem?
I creat the list by: function creattags() { $(document).ready(function() { function creattags(event) { event.preventDefault(); $.getJSON("json/tags.json", function(data) { var html = ''; html +='
' $.each(data, function(entryIndex, entry) { html += '- ' + entry.tags + '
';
});
html +='
' $('#tagwarp1').html(html); })} creattags();
My data is: [ {"id": "0", "tags": "t1"},{"id": "1", "tags": "t2"}, {"id": "2", "tags": "t3"} ];
I get the result like this.
Tagit doesn't work on this list creat by tags.json, but it works on the list creat by the data in my js. How can I sholve this problem?