i use this code and it works when i download the volusion api into "teak_test.xml" here is the code:
$(document).ready(function(){
$.ajax({
type: "GET",
url: "teak_test.xml",
success: function(data) {
$(data).find('Products').each(function(){
var Col0 = $(this).find('ProductCode').text();
// check if Col0 = SABAH
if (Col0 === $( "span.product_code" ).text()) {
var Col1 = $(this).find('Fixed_ShippingCost').text();
$('<div><span class="product_code_title">Fixed Shiping Cost:</span><span id="inside_qty_instock"> $'+Col1+'</span></div>').appendTo('td#pricebox_top div.qty_in_stock');
}
});
}
});
});
but it doesn't work if i call the api direct from external url:
http://www.mywebsite.com/net/[email protected]&EncryptedPassword=123456&EDI_Name=Generic\Products&SELECT_Columns=p.ProductCode,pe.Fixed_ShippingCost
i found article from volusion and the code is:
var api_url = "http://www.mydomain.com/net/WebService.aspx?
[email protected]&EncryptedPassword=1234567890QWERTYUIOPASDFGHJKL&EDI_
Name=Generic\Customers&SELECT_Columns=CustomerID,
AccessKey&WHERE_Column=AccessKey&WHERE_Value="C"";
var xmlhttp;
var api_response = "";
xmlhttp = new ActiveXObject("MSXML2.ServerXMLHTTP");
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
api_response = xmlhttp.responseText;
} else {
//unable to connect
}
} else {
//connecting...
}
}
xmlhttp.send();
anyone knows how to implement it? i'm new about this stuff
thanks
Forget it, i already able to figure it out!
it basically simple:
here's the code:
the key is by adding
\\
after "Generic" from the original api link:to this link:
Hope this can help yall that having the same problem get xml API from Volusion