Append data clear after second click
-
Hi,
I am using WordPress 3.1.2. This time i have one doubt, same time using wordpress JSON API plugin in my website. i try this code in sample.js file
function displayBrandDesign(){
$(“#brand-design”).show();
$.ajax({
type: “GET”,
//url: “api/get_recent_posts/?custom_fields=gallery_thumb,gallery_zoom&slug=’brand-design'”,
url: “api/get_category_posts/?custom_fields=gallery_thumb,gallery_zoom&slug=’brand-design'”,
dataType: “json”,
success: function(data){
$.each(data.posts, function(index, value) {
c.append(‘<img src=”‘+value.custom_fields.gallery_thumb+'”/>’);
});
}
});
}in html file :-
using like this
Brand Design
<div id=”brand-design”></div>what my doubt is, when i click the Brand Design button. First time its showing properly, but second time clicking the Brand design link its appened and continuously showing same custom field image.
When i second click the link, same time clear the data in #brand-design div items, and showing without append function. how can i use the jquery code.
thank U
vjn_23
- The topic ‘Append data clear after second click’ is closed to new replies.