I'm making the call using the following script which is called on click of an anchor tag
function GetToken(videoId) {
debugger;
var json = $.getJSON("/Vod/RequestAccessToken/"+videoId, function(result){
alert("token recieved: " + result.token);
});
}
In the server application I recieve the call so I know it is a valid URL, but the callback is not being invoked. If i set though the jquery code (f11/f10) the callback is called??!!!?
Server returns results from MVC application in the form of a class
// function called
public JsonResult RequestAccessToken(int id)
{
Token t = new Token();
t.MasterId = Guid.NewGuid();
var result = new TokenResult(t.MasterId);
return this.Json(result, JsonRequestBehavior.AllowGet);
}
// class returned
public class TokenResult
{
public TokenResult() { }
public TokenResult(Guid g) { token = g.ToString(); }
public string token = null;
}
Whe I access the url via browser result =
{
"token":"c877453e-739d-4883-9310-91ddd707d6af"
}