简体   繁体   中英

parsing jsonp with jquery

I receive the folowing jsonp through a jQuery call :

DisplayDates({"dates":[ "10\/2012","9\/2012"]})

when I try display to the array in Firefox / Chrome, 'dates' only has 1 item "9/2012".

I have no clue why. I suppose the json is not properly formated but what should it be ?

My test code is :

function DisplayDates(data) {
    console.log(data);
}

$(function () {
    $.ajax({
        type: 'GET',
        url: 'http://url?alf_callback=DisplayDates',
        dataType: 'jsonp'
    });
});

EDIT: I added other items and they appear. The only item not appearing is "10\\/2012" . Why ?

我真是个白痴……我的页面和其他调用都没有查询相同的确切网址(在guid中,参数略有变化),但我没有看到它。……感谢您的所有测试

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM