它是如何工作的这个javascript“var ApplicationConfig = {”

时间:2013-02-12 09:19:10

标签: javascript json jquery

如何在" var ApplicationConfig = {" and " ApplicationForm: { submitUrl: validateFieldUrl:processWindowUrl:rejectedUrl:"

中工作
<script type="text/javascript">
    var ApplicationConfig = {
        mobile: false,
        messages: {"account_number_format_error":"4-30 digits are needed in the field &quot;Account Number&quot;"},
        ApplicationForm: {
            submitUrl: 'application-submit.php',
            validateFieldUrl: 'application-validate-field.php',
            processWindowUrl: 'application-process.php',
            rejectedUrl: 'page-reject.php'
        },
        multipartTextfieldContainer: '.dev-form-multipart-text-field',
        autocomplete: {
            url: 'application-autocomplete.php'
        },
        abTestValues: {"igf_frm_small":"1"}    };
</script>

1 个答案:

答案 0 :(得分:0)

这是object literal

这是一种在同时定义属性和值的同时构建基本对象的方法。

var foo = { bar: baz; };

相当于:

var foo = new Object();
foo.bar = baz;