Stack Overflow Asked by ookie on December 3, 2020
I have an Ajax post to a web-service, that calls to a stored procedure. Everything works great, accept when I reference the return data, I received Undefined for my variables.
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "../FileService.asmx/GetActiveList",
data: "{'dcode':'" + dcode + "', 'actcust':'" + actcust + "', 'mcont':'" + mcont + "'}",
dataType: "json",
success: function (response) {
console.debug(response.d)
var vids = response.d;
var vlist = "";
$('#player_default').empty();
vlist += '<ul class="player_list">';
$.each(vids, function(vids) {
vlist += '<li data-bottom-thumb="upload/' + dcode + '/' + vids.fileloc + '" ' +
'data-title="' + vids.title + '" ' +
'data-desc="' + vids.descvid + '" ' +
'data-youtube="' + vids.ytid + '" ' +
'data-category="' + vids.categories + '"></li>';
});
My dcode variable is working fine, however my vids.xxxx are the ones coming back undefined. Possible for someone to point me in the correct direction..?? Thank you
response.d
{"d":[{"ytid":"14sA-SpS7D0","Descvid":"Honda Concept","Thumbnail":null,"Fileloc":"West-Nipissing-Martial-Arts.png","Categories":"action;comedy;adult","title":"Civic Concept","descimg":null,"filename":null,"sortord":null},{"ytid":"14sA-SpS7D0","Descvid":"Honda Concept","Thumbnail":null,"Fileloc":"West-Nipissing-Martial-Arts.png","Categories":"action;comedy;adult","title":"Civic Concept","descimg":null,"filename":null,"sortord":null}]}
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP