开发者

Aptana shows syntax errors with JSON data declaration?

开发者 https://www.devze.com 2023-03-30 00:28 出处:网络
I am using Aptana 3, and it is giving a little red cross saying there is a syntax error when I have this in a .html file.

I am using Aptana 3, and it is giving a little red cross saying there is a syntax error when I have this in a .html file.

    <script>
    var data = [
            {'name':'Name1', 'email':'a@email.com'}]
    </script>

I don't have problem running the script, and Dreamweaver doesn't throw an error.

What's wrong?

UPDATE: If I save it as a .js and remove the tag, the warning goes away. But what not in html开发者_Go百科

Aptana shows syntax errors with JSON data declaration?

0

精彩评论

暂无评论...
验证码 换一张
取 消