This is my script which appends the response on the page…but the appended buttons are not working.
- onclick not working;
- .live() notworking .
but if i write any function after this line it works.
$("#responseWrapper").append(htmldata)(in the success function)
it means for handling appended items i hv to write query inside the success function ???
is there another way??
[PHP]$(document).ready(function() {
var db = $("#db").val();
var homepage = $("#homepage").val();
var dataString = ‘db=’ + db + ‘&homepage=’ + homepage;
jQuery.ajax({
type: "GET",
url: "/processor/process.homeshowcase.php",
data: dataString,
success:function(response){
var myArray = $.parseJSON(response);
var htmldata =’’;
for (var i = 0; i < myArray.length; i++)
{
var obj = myArray[i];
htmldata=htmldata+'<div class ="itemWrapper well span12 " id="'+obj.id+'"><form class="items" id="'+obj.id+'" action="" method="post">Season Name:<br/><input type="content_txt" value="'+obj.title+'" class="videoName" ><br>Description:<br/><textarea class="description span5" rows="5">'+obj.content+'</textarea ><br><input class="videosubmit" id="up_'+obj.id+'"type="button" value="Update" ><input class="delBtn" id="del_'+obj.id+'" type="button" value="delete" ></form><div class="showcaseItem"><img src="'+obj.location+'"height="180" width="320"><input type="file" class="button" multiple></div></div>';
}
$("#responseWrapper").append(htmldata);
},
error:function (){
alert(“Insert a valid playlist Id”);
}
});
})[/PHP]