I am creating a website using volusion store. I want the products to displayed on products page and for that I am customizing the code. I have created the volusion api i.e, standard exports and I just need to fetch that products details to page using that api with ajax. so how do I achieve that? For the first type I have created api with .xml extension e.g, https:///dataport/dl/Generic/Products.xml then it shows the data and I can also fetch that data but for the second type of url e.g, http:///net/WebService.aspx?Login=&EncryptedPassword=&EDI_Name=Generic\Products&SELECT_Columns=p.ProductID,p.ProductName,pe.Photo_AltText,pe.Photo_SubText,pe.PhotoURL_Large,pe.PhotoURL_Small,pe.Price_SubText,pe.Price_SubText_Short,pe.ProductPrice,pe.ProductPrice_Name I can't able to fetch that data using ajax. Although using this url for the first time it shows data but when I refresh it then it doesn't show.
Below I have shared my code so please review it and help me to solve this issue,
<script>
$(document).ready(function(){
$.ajax({
type: "POST",
url: "http://<domainname.com>/net/WebService.aspx?Login=<username>&EncryptedPassword=<password>&EDI_Name=Generic\Products&SELECT_Columns=p.ProductID,p.ProductName,pe.Photo_AltText,pe.Photo_SubText,pe.PhotoURL_Large,pe.PhotoURL_Small,pe.Price_SubText,pe.Price_SubText_Short,pe.ProductPrice,pe.ProductPrice_Name",
dataType: "xml",
success: function(result) {
alert(result);
parseXml(data);
}
});
});
function parseXml(data) {
var id;
var code;
var name;
$(data).find('Products').each(function( ){
$(this).find("ProductCode").each(function() {
code = $(this).text();
});
$(this).find("ProductID").each(function(){
id = $(this).text();
});
$(this).find("ProductName").each(function(){
name = $(this).text();
});
$('.col-md-6').append(code +"<br />"+ id +"<br />"+ name);
});
}
</script>
<div id='getresult'>
Api code will refelect here
<div class="container">
<div class="row">
<div class="col-md-6"></div>
</div>
</div>
</div>