Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Latest commit

 

History

History
43 lines (29 loc) · 835 Bytes

README.md

File metadata and controls

43 lines (29 loc) · 835 Bytes

iframejs

A jquery plugin for submitting forms via an iframe and then getting a response back via postMessage

If the response is a parseable json string it will be parsed into json, otherwise it will return the entire body as the response.

Example usage

// Example Response

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript"> $(function() { window.postMessage( $(document.body).html(), "http://localhost" );

}) </script>

{payment: 'success'}

$("form").iframeSubmit(function(response) { console.log("response", response); });

To run specs (Must have node package manager installed) npm install node app.js open the browser to http://localhost:8080/specRunner.html