• This repository has been archived on 20/Mar/2021
  • Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 13 years ago
  • Updated over 13 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

FlyJSONP is a small JavaScript library, that allows you to do cross-domain GET and POST requests, with JSON response.

Overview

FlyJSONP is a small JavaScript library, that allows you to do cross-domain GET and POST requests with remote services that support JSONP, and get a JSON response. Have a look at the demo to see it in action, or check out get started guide for usage instructions, and examples.

Links

Features

  • Cross-domain GET, as well as POST requests, with JSON response. POST requests pass through YQL.
  • Control over the callback parameter name for GET requests.
  • No other dependency on other JavaScript frameworks.

Quick Usage Guide

To get started, first download FlyJSONP, and add it to your code. Then simply call init method to setup the initial options.

<script src="/path/to/flyjsonp.js"></script>
<script>
FlyJSONP.init({debug: true});
</script>

GET Request

To issue a cross-domain GET request, you call the get method. It accepts number of options, and calls success callback when provided, with JSON response.

FlyJSONP.get({
  url: 'http://storify.com/xdamman.json',
  success: function (data) {
    console.log(data);
  },
  error: function (errorMsg) {
    console.log(errorMsg);
  }
});

POST Request

To issue a cross-domain POST request, you call the post method. It accepts number of options, and calls success callback when provided, with JSON response. To get around cross-domain issues for POST requests, FlyJSONP uses YQL to send the request and retrieve the response.

FlyJSONP.post({
  url: 'http://storify.com/story/new',
  parameters: {
    username: 'your-username',
    api_key: 'secret-api-key',
    title: 'FlyJSONP',
    description: 'Testing it out'
  },
  success: function(data) {
    console.log(data);
  }
});

License

FlyJSONP is a project of Abdulrahman Al-Otaiba, the project is dual-licensed under GNU GPLv3, and MIT. See LICENSE for more details.

Thanks

I would like to thank the following people, and give them credit for their awesome work:

  • Johannes Charman - For creating YQL data table 'jsonpost'
  • Christian Heilmann - For creating YQL data table 'htmlpost'

More Repositories

1

SiriProxy-Asiri

Let Siri speak your language with Asiri plugin for SiriProxy. Thanks to Google speach recognition service, Asiri can be configured to speak any language that is supported by Google.
Ruby
30
star
2

Auto-Input-Text-Direction

Auto Input Text Direction is a little JavaScript function that detects the input language, on html forms, and changes the input direction based on the language, i.e., right to left for the Arabic language.
JavaScript
12
star
3

HT1635B

HT1635B LED Matrix I2C library for Particle
C++
5
star
4

Qontacts--Android

Qontacts is a mobile application that updates the address book contacts numbers, to the new Qatari numbering scheme 2010 (Android version).
Java
4
star
5

PCA9534

PCA9534 I/O expander library with for Particle for easy interfacing with PCA9534 chip.
C++
3
star
6

LED_GFX

Particle library that allows for easy text control with effects on HT1635B controlled LED matrix.
C++
3
star
7

speer

speer is a C library which decodes speex files used in Siri protocol, to PCM 16bit Little-Endian. It's used by Asiri, the SiriProxy plugin for multi language.
C
3
star
8

AccelStepperSpark

This is the Arduino port of AccelStepper library for Particle devices. It provides an object-oriented interface for 2, 3 or 4 pin stepper motors.
C++
3
star
9

KeyngFu

KeyngFu is a bookmarklet that re-enables readonly fields on a web page, and shuts down all fields' associated events, such as displaying virtual keyboards.
JavaScript
3
star
10

Qontacts--Qt

Qontacts is a mobile application that updates the address book contacts numbers, to the new Qatari numbering scheme 2010 (Qt version for Maemo).
C++
2
star
11

Arabic-Links-For-Print

Arabic Links For Print jQuery plugin improves the readability of printed web pages, by placing all the links on footnote, on the bottom of the page.
JavaScript
2
star
12

Inline-Text-Direction

Inline Text Direction plugin for WordPress changes the direction of inline foreign text that is written from "Right to Left" that are embedded within Latin languages that are written from "Left to Right". and vice versa.
JavaScript
2
star
13

Qontacts--iOS

Qontacts is a mobile application that updates the address book contacts numbers, to the new Qatari numbering scheme 2010 (iOS version).
Objective-C
1
star
14

Qontacts--BlackBerry

Qontacts is a mobile application that updates the address book contacts numbers, to the new Qatari numbering scheme 2010 (BlackBerry version).
Java
1
star
15

Author-Slug-Field

WordPress plugin that adds a new field in the profile page, to enable editing the user_nicename field which controls the URL of authors home page.
PHP
1
star
16

Qontacts--MIDP

Qontacts is a mobile application that updates the address book contacts numbers, to the new Qatari numbering scheme 2010 (Java ME MIDP 2.0 version).
Java
1
star