A tool for submitting forms via an iframe and then getting a response back via postMessage
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
spec
src
.gitignore
LICENSE
README.md
SpecRunner.html
app.js
package.json

README.md

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