Skip to content

karlerikjonatan/framer-module-ajax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

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:

ajax = require "ajax"

framer.module.ajax consists of the method get and requires the parameters url, callback.

get

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

# 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
	)

About

An Ajax module for Framer.

Topics

Resources

License

Stars

Watchers

Forks

Languages