how to send data array format in ajax jquery

Dec 3 2017 12:30 AM
its very urgent
 
i want data like bellow format
 
data-zs-src="["https://unsplash.it/1600/1607?image=180", "https://unsplash.it/1600/1607?image=170", "https://unsplash.it/1600/1607?image=160"]"
 
but its came like this
 
data-zs-src="https://unsplash.it/1600/1607?image=180", "https://unsplash.it/1600/1607?image=170", "https://unsplash.it/1600/1607?image=160"
 
<div id="demo-1" data-zs-src='' "data-zs-overlay="dots"></div>
$(document).ready(function () {
$.ajax({
url: "https://www.q-tickets.com/qatarcinemas.aspx?type=3",
type: "Get",
success: function (data) {
var obj = JSON.parse(data);
var jdd = obj.Thumbs[1].poster_path;
var ss = "http://www.q-tickets.com/";
var arr = [];
for (var i = 0; i < obj.Thumbs.length; i++) {
console.log(ss + obj.Thumbs[i].poster_path);
var imagesurls = ss + obj.Thumbs[i].poster_path;
arr.push(imagesurls);
//alert(imagesurls)
}
$('#demo-1').attr('data-zs-src',arr);
// $('#amount').data('min', '1000')
},
error: function (msg) { alert(msg); }
});
});
</script>

Answers (1)