Sublimelinter&JSHint抱怨Facebook的Open Graph对象

问题描述:

我使用JSHint和SublimeLinter与Sublime Text 3,但是当使用Facebook API时,它不像结构中的对象双重: ,例如。 { og:url: 'example.com' }Sublimelinter&JSHint抱怨Facebook的Open Graph对象

FB.api(
'me/objects/my-app:object', 
'post', 
{ 
    og:url: http://samples.ogp.me/12345678910, 
    og:title: Sample Object, 
    og:type: my-app:object, 
    og:image: https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png, 
    og:description: , 
    fb:app_id: 12345678910, 
    place:location:latitude: Sample Location: Latitude, 
    place:location:longitude: Sample Location: Longitude 
}, 
    function(response) { 
     // handle the response 
    } 
); 

我知道如何忽略某些变量的名字在我的项目的根目录中的文件.jshintrc,但不知道如何阻止它抱怨这种结构。我以为Facebook API很受欢迎,因此值得在此发布。

+0

这是否甚至工作?因为肯定是不正确的JavaScript/JSON。 – luschn

+0

这是Facebook在开发人员工具中生成的示例代码 - 所以即时猜测它的正确语法。 Facebook寻找的页面上的示例标记是: conor909

用引号括起来。 例如。 { 'og:url': 'example.com' }