javascript – 什么是任意数据/ JSON?

我最近遇到了任意数据/任意json一词,我似乎无法理解究竟是什么和/或找到任何文件.我知道 JSON是一种通过互联网发送数据的格式,那么格式究竟是如何随意的呢?

编辑::

//更多代码

var buildItem = function(item) {
    var title = item.name,args = [],output = '<li>';

    if (item.type == 'method' || !item.type) {
      if (item.signatures[0].params) {
        $.each(item.signatures[0].params,function(index,val) {
          args.push(val.name);
        });
      }
      title = (/^jQuery|deferred/).test(title) ? title : '.' + title;
      title += '(' + args.join(',') + ')';
    } else if (item.type == 'selector') {
      title += ' selector';
    }
    output += '<h3><a href="' + item.url + '">' + title + '</a></h3>';
    output += '<div>' + item.desc + '</div>';
    output += '</li>';

    return output;
  };

//more code

在上面的示例代码中,我被告知.params是来自JSON请求的任意数据[用于jQuery api文档].

什么是任意数据?

非常感谢任何答案和/或澄清.

jsfiddlehttp://jsfiddle.net/QPR4Z/2/

谢谢!

解决方法

arbitrary |ˈärbiˌtrerē|
adjective

based on random choice or personal whim,rather than any reason or
system: his mealtimes were entirely arbitrary.

  • Mathematics: (of a constant or other quantity) of unspecified value.

这只意味着那里可能有任何价值.这与一个说“像这个数组总是包含X,Y和Z”的规范相反.相反的任意值说“我们在这个阵列中发送了一些东西,但我们不能事先告诉你究竟是什么.”如果你被告知你可以自己发送任意数据,这意味着你可以发送任何你想要的东西,它不必遵循任何特定的格式.

请注意,这完全是关于JSON格式中包含的数据,而不是JSON格式本身.

相关文章

前言 做过web项目开发的人对layer弹层组件肯定不陌生,作为l...
前言 前端表单校验是过滤无效数据、假数据、有毒数据的第一步...
前言 图片上传是web项目常见的需求,我基于之前的博客的代码...
前言 导出Excel文件这个功能,通常都是在后端实现返回前端一...
前言 众所周知,js是单线程的,从上往下,从左往右依次执行,...
前言 项目开发中,我们可能会碰到这样的需求:select标签,禁...