【问题标题】:Using Parse Javascript SDK in Objective J Cappuccino Project在 Objective J Cappuccino 项目中使用 Parse Javascript SDK
【发布时间】:2016-07-18 01:40:03
【问题描述】:

由于可以在 Objective J 中执行有效的 Javascript 代码,我将如何添加 Parse SDK?

跟随本教程:Parse JS SDK

在我的项目中,我无法添加 HTML 脚本标签:

<script src="//www.parsecdn.com/js/parse-1.6.14.min.js"></script>

我也不能使用:

var Parse = require('parse');

导入 Parse 的正确方法是什么?

【问题讨论】:

    标签: javascript parse-platform cappuccino objective-j


    【解决方案1】:

    您需要将脚本标签添加到您的 index.html 和 index-debug.html。在这些文件中,您将看到:

    <!-- Custom javascript goes here -->
    <!-- End custom javascript -->
    

    所以改成:

    <!-- Custom javascript goes here -->
    <script src="//www.parsecdn.com/js/parse-1.6.14.min.js"></script>
    <!-- End custom javascript -->
    

    然后根据您提到的文档,您需要将您的应用连接到 Parse 服务器:

    Parse.initialize("YOUR_APP_ID");
    Parse.serverURL = 'http://YOUR_PARSE_SERVER:1337/parse'
    

    如何将它添加到“init”方法中:

    - (id)init
    {
        self = [super init];
        if (self)
        {
            Parse.initialize("YOUR_APP_ID");
            Parse.serverURL = 'http://YOUR_PARSE_SERVER:1337/parse'
        }
    
       return self;
    }
    

    启动 Python 网络服务器:

    python -m SimpleHTTPServer
    

    在浏览器 localhost:8000 中检查您的应用

    【讨论】:

      猜你喜欢
      • 2011-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多