0

I am calling webservice using below method.

// This is flicker API and it is working fine.

//var url="http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?"; 

// This is my created webservie and it is not working

var url="http://windowsdemo.projectstatus.co.uk/B60/B60Services.asmx/getBanners?jsoncallback=?"; 

This is method

        $.getJSON(url,
        function(data){
          alert(JSON.stringify(data));
        });

If I use my created webservice then it show this error Uncaught SyntaxError: Unexpected token : And flickr api is returning data properly.

While both are returning data if I put in browser. What may be the issue.

Please help

4

2 回答 2

0

您正在尝试解析无效的 JSON 响应,因此出现Unexpected token :错误。

将其通过jsonlint并尝试纠正异常。

于 2013-08-13T07:54:19.683 回答
0

crossdomain.xml在您的基本目录中使用。

于 2013-08-13T07:28:25.757 回答