Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karlerikjonatan/framer-module-ajax
An Ajax module for Framer.
https://github.com/karlerikjonatan/framer-module-ajax
framer
Last synced: about 2 months ago
JSON representation
An Ajax module for Framer.
- Host: GitHub
- URL: https://github.com/karlerikjonatan/framer-module-ajax
- Owner: karlerikjonatan
- License: mit
- Created: 2015-03-27T09:34:57.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-28T09:16:25.000Z (about 9 years ago)
- Last Synced: 2024-08-03T00:10:13.337Z (5 months ago)
- Topics: framer
- Language: JavaScript
- Homepage:
- Size: 582 KB
- Stars: 21
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-framer - framer.module.ajax - Ajax module for Framer. (Modules)
README
# framer.module.ajax
framer.module.ajax is an Ajax module for Framer.## Installation
Add ```ajax.coffee``` to the /modules folder of your project.## Usage
To include the module within your project, add the following:``` coffeescript
ajax = require "ajax"
```framer.module.ajax consists of the method ```get``` and requires the parameters ```url```, ```callback```.
#### get
``` coffeescript
ajax.get(url, (response) -> callback(response))
```
The ```url``` and ```callback``` parameters defines the URL to request and the function to run (together with response object) on success.framer.module.ajax parses all responses as ```JSON```.
### Example
``` coffeescript
# Module
ajax = require "ajax"# GET
ajax.get("https://randomuser.me/api/", (response) -> createAvatar(response))# Avatar
createAvatar = (data) ->
avatar = new Layer(
height: 200
width: 200
image: data.results[0].user.picture.large
)
```