weixin_33701617 2015-09-09 11:44 采纳率: 0%
浏览 3

:在ajax数据中的功能:(

We wonder what the colon, :, in data does. We understand that the data is posted to list.php but not exactly how.

function paint(val){
        $(".loading").css("display","block");
        $.ajax({
            type:"POST",
            url: "paint.php",
            data:{
                target:val,
                PaintedObjects:PaintedObjects, 
            },
            dataType: 'json',
            success:  function(data){

Thank you!

  • 写回答

4条回答 默认 最新

  • weixin_33712987 2015-09-09 11:50
    关注

    It separates the key name from the value, the same function it operates in the rest of the code you posted (url: etc)

    Read more about JSON here

    An object is an unordered set of name/value pairs. An object begins with { (left brace) and ends with } (right brace). Each name is followed by : (colon) and the name/value pairs are separated by , (comma).

    评论

报告相同问题?