Hello guys ,
Stuck at a problem for two days . The problem is that i am trying to hit a webservice from localhost .
Just for testing purposes i wrote this code and it ran the way it was supposed to :
<a href="http://www.zipdial.com/z2v/startTransaction.action?customerToken=mycustomertoken&clientTransactionId=1&callerid=9968280904&duration=180&countryCode=91&z2vToken=another_token">Save</a>
As you can see , everything is static and it works like a charm because i see something like this on the browser :
{"message":"ok","client_transaction_id":"2","transaction_token":"sometoken","status":"1","img":"http://www.zipdial.com/zip2auth/images/access/b8b7ad5781c6f07b775f623ab62f4f8d34f81570"}
Now i need to extract the img element from it but i have no idea in how to go about it .
I tried using jquery like this :
$(document).ready(function() {
alert('hello');
$.getJSON("http://www.zipdial.com/z2v/startTransaction.action?customerToken=mycustomertoken&clientTransactionId=2&callerid=9968280904&duration=180&countryCode=91&z2vToken=another_token",function(jd)
{
alert("hello again");
alert(jd.image);
});
});
Now i only see the alert("hello") as a pop up but nothing inside the function call and on my browser i see this
"
Origin http://server_name is not allowed by Access-Control-Allow-Origin."
Please help