Reputation: 693
Ok, so I am building a CMS one of the features I wanted to add is ability for me to send messages to my friends which are also using the CMS currently in development mode. This point of the idea is to allow more fluent communication between me and them, since e-mail can be delayed sometimes and here i want to send a simple message to them. With something like following format
Name: Avatar: Subject: Date: Message:
I am pretty sure this can be easily rigged together with PHP and JSON just assuring the access to the JSON file is secure in which I implemented something like access key which checks if the site requesting the file matches site host, and matches the key.
In any case sorry for my babling, this is my way. But folks I would like to know what would you suggest in making cross-domain messaging system build in into a PHP + jQuery based CMS? In terms of being robust, fast, secure and easy to work with.
Upvotes: 0
Views: 362
Reputation: 1211
Exchange data in the jsonp format, http://en.wikipedia.org/wiki/JSONP.
Server:
How to convert php to jsonp with json_encode.
http://1080d.com/lang/en-us/2009/10/converting-php-to-jsonp-with-json_encode/
Client:
Ajax example of jsonp data call. This particular example concerns the timeout feature but is an excellent example of how to set it up.
jQuery ajax (jsonp) ignores a timeout and doesn't fire the error event
Upvotes: 1