Блог пользователя terserah

Автор terserah, история, 9 лет назад, По-английски

Hello. I'd like to ask how to request CF API using AJAX. Here is my code :

$.ajax({
       type : "GET" , 
       url : "http://codeforces.com/api/problemset.problems?tags=implementation",
       success : function(data) {
           alert("success");
       } , 
       error : function(data) {
           alert('fail');
       }
});

The AJAX call returns nothing. How do I solve this issue? Thanks!

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by terserah (previous revision, new revision, compare).

»
9 лет назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится

If you're using something newer than IE6 then open a debug panel and check the error there. Probably you have cross-domain call rejected. Read about JSONP in the CF API guide.