I get an object from youtube and upload data to a table on the site. There is a code:
productsModule.controller("addNewVideo", function ($scope, $http, $rootScope) { $scope.addNewVideo = function () { /*====== GET DATA FROM YOUTUBE API =========*/ $.getJSON('https://www.googleapis.com/youtube/v3/videos?id=' + $scope.videourl + "&key=AIzaSyDnyf5NK_oWcdWjFw6VrILvGg2STG292eE&part=snippet&callback=?", function (data) { if (typeof (data.items[0]) != "undefined") { var title = ""; title = JSON.stringify(data.items[0].snippet.title); title = title.substring(1, title.length - 1); title = title.split("-"); console.log(data.items[0]); //====== CREATE OBJECT OF NEW SONG var newSong = { "artist": title[0], "song": title[1], "songID": $scope.videourl } // $scope.videourl = "test11" ; var tr = '<tr><td class=" songID hide" contenteditable="false">' + $scope.videourl + '</td><td id="artistName" class="x2" name="x1" contenteditable="true">' + title[0] + '</td> <td id="songName" contenteditable="true">' + title[1] + '</td><td> <span class="table-remove glyphicon glyphicon-remove"></span></td><td> <span class="table-play glyphicon glyphicon-play-circle"></span></td><td> <span class="table-save glyphicon glyphicon-save"></span></td></tr>'; $("#songTable").append(tr); I get a string on my website with data. (There may be as many lines as possible) the next act of Marlezonsky ballet - when I click on the "save" button, I have to pick up the data from my HTML page and send it to the database. You need to pick up the ID, the name of the artist and the name of the song. I can't get through to the data.
// add song to table songs $('.table-save').click(function () { // удалить запись о песне // var x1 = $(this).find("x1").value; var x1 = $(this).parent().find(".x2").val; alert(x1); came to the fact that I get a lot of data ... but what next ???

var x1 = $(this).parent().parent().find(".x2").val;- L. Vadimмного данныхis a function that should have been called. - vp_arth