jQuery Encrypted API - XML display -
is there way parse xml encrypted api via jquery? need use ajax? have examples? have:
http://www.mysite.com/net/webservice.aspx?login=email@email.com& encryptedpassword=xxxxx&edi_name=generic\products& select_columns=p.productcode,pe.productprice
this returned xml return , parse table or something:
<?xml version="1.0" encoding="iso-8859-1"?> <export> <products_joined> <productcode>product 1</productcode> <productprice>1500</productprice> </products_joined> </export>
yes, assuming have access run javascript on server, this:
var url = 'http://www.mysite.com/net/webservice.aspx?...'; $.ajax({ type: 'get', url: url, datatype: 'xml', success: function(xml) { var table = $('#mytable-id'); $(xml).find('products_joined').each(function(){ var product = $(this), code = product.find('productcode').text(), price = product.find('productprice').text(); $('<tr />').append('<td>' + code + '</td>') .append('<td>' + price + '</td>') .appendto(table); }) } });
Comments
Post a Comment