Hi Friends,
I would really appreciate for any kind of advice!!
Below is a code I am using to make an API call and its not working properly.
Actually the ajax part is not working
$('#mainContainerMainPage').append('<li class="listitem"> <p class="paddtittle"><a href="https://a2atest.wildcardsystems.com/a2a/CO_LoadValue.asp?userid=xxxxxx&pwd=xxxxx&sourceid=xx&cardnum=xxxxxxxx&purseno=14&amount=10&resp=html"> Confirm Load Value </a> </p></li>');
above lines works fine what it does is to make a html element dynamically and it creates a an html element with heref link which is when pressed makes an API call
and the response I get is in html or xml format but the problem is I cannot grab the response and show that in a customized format. so I tried another way which is ajax call for the api call to grab the response and use further but its not working no response I don't know if I am doing some thing wrong or there is some other way of doing it. Can you help me make a proper ajax call and grab the results?.
Code starts here
$(document).ready(function() {
$('#makecall').click( function() {
$('#mainContainerMainPage').append('<li class="listitem"> <p class="paddtittle"><a href="https://a2atest.wildcardsystems.com/a2a/CO_LoadValue.asp?userid=xxxxxx&pwd=xxxxx&sourceid=xx&cardnum=xxxxxxxx&purseno=14&amount=10&resp=html"> Confirm Load Value </a> </p></li>');
$.ajax(
{
url:'https://a2atest.wildcardsystems.com/a2a/CO_LoadValue.asp?',
type:'POST',
data: {userid:'xxxxxxxx', &pwd:'xxxxxxx',&sourceid:'xx',&cardnum:'xxxxxxxxx',&purseno:'14',&amount:'10',&resp:'html'},
success: function(data)
{
$('#mainContainerMainPage').append(data);},
error: function(data)
{
$('#mainContainerMainPage').append(data);}
});
});
Thanks! in Advance