Results 1 to 2 of 2

Thread: dynamically appended items doesn't work

  1. #1
    Join Date
    Nov 2013

    dynamically appended items doesn't work

    this function appends into html document .
    $(document).ready(function() {
    $("body").ready(function (e) {
    var showId = $("#showId").val();
    var sId = $("#sId").val();
    var offSet = $("#offSet").val();
    var rowsPerPage = $("#rowsPerPage").val();
    var db = $("#db").val();
    var dataString = 'sId=' + sId + '&db=' + db + '&showId=' + showId + '&offSet=' + offSet + '&rowsPerPage=' + rowsPerPage;
    type: "GET",
    url: "/upload/videoupdate.php",
    data: dataString,
    var myArray = $.parseJSON(response);
    var htmldata ='';

    for (var i = 0; i < myArray.length; i++)
    var obj = myArray[i];
    htmldata=htmldata+'<div class ="videowrapper well" id="'+obj.id+'"><form class="video" id="'+obj.id+'" action="" method="post">VideoName:<br/><input type="content_txt" value="'+obj.yt_title+'" class="videoName" ><br>Description:<br/><input type="content_txt" value="'+obj.description+'" class="description"><br><input class="videosubmit" id="'+obj.id+'"type="button" value="Update" ><input class="delBtn" id="'+obj.id+'" type="button" value="delete" ></form><div class="video1"><img src="'+obj.thumb_medium+'"height="180" width="320"></div></div>';

    error:function (){
    alert("Insert a valid playlist Id");



    and it is the code which on click executes but its not working need help

    $(document).ready(function() {

    $(".videosubmit").on('click',function (e) {

    var id= this.id; alert(id);

  2. #2
    Join Date
    May 2006
    Somewhere behind your screen
    1. using [code]your code goes here[/code] tags can significantly increase your chance of getting help
    2. it's not clear what exactly doesn't work or what error(s) are you getting
    3. try this

    $(document).ready(function() {
    var id= $(this).attr('id');alert(id);
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles