function getval(data) {
alert(data['url']);
}
$(document).ready(function () {
var bingAPIUrl = "http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US&callback=getval";
$.support.cors = true;
var result = $.getJSON(bingAPIUrl, getval(data));
});
I am trying to get the url property of get the image url from bing, can someone help me why the data result is undefined in my callback function 'getval'