Google API in Javascript

前端 未结 4 2000
半阙折子戏
半阙折子戏 2020-11-29 11:10

I am trying to get calendar info from google in javascript. I ve read \'how to\' manuals. They didn\'t help. Even this \'helpful\' copypasted code (to authorize) didn\'t. Wo

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 11:39

    Some APIs will work fine when queried from local files, but some won't. In response to an error such as yours, try to serve your files from a web server. If you need a quick web server running, use Python's builtin HTTP server (Mac OSX and Linux systems have Python pre-installed). This HTTP server can turn any directory in your system into your web server directory. cd into your project directory and run the following command: python -m SimpleHTTPServer 3000 The number at the end is the port number your http server will start in and you can change that port number. In our example, your directory would be served from: http://localhost:3000.

提交回复
热议问题