Saturday, April 12, 2014; 10:10:46 AM Eastern
Interapplication communication in JavaScript
- How are we going to do interapplication communication between apps written in JavaScript running on the same machine?
- #### I use localStorage
- The client app stores a string in known location. The server watches that location. When a string shows up, convert it to uppercase, delete the string, and store the new string in another known location.
- The client app is watching that location, when a value shows up, it displays it for the user.
- #### A limit
- There is a limit -- the two apps have to originate from the same domain, because only apps from the same domain can share space in localStorage.
- #### Example app
- The example app is in a GitHub repository.
- https://github.com/scripting/interAppComm
- Download the client and server and drag them into your browser.
- Enter a string in the client. Click the Submit button. See the result.
- #### Seeing is believing
- Some people don't believe this works. It does.
- I've deployed it in a real-world app, and there have been no support issues.
- And with this demo, you can see with your own eyes.