The preferred way is to use JQuery .
There is a messaging concept in which I have used this in several projects. If you do not know about this, click this link.
If you travel on the Internet, you can find many posts related to it.
For your feasibility, I have posted a link below that will be useful to you:
jquery-postmessage-plugin
jquery-ba-postmessage-js
postmessage.freebaseapps.com
Example:
pm({ target: window.frames["example2"], type:"message2", data:{hello:"world"}, success: function(data) { $("#example2").after(JSON.stringify(data)); } }); pm.bind("message2", function(data) { $(document.body).append(JSON.stringify(data)); return {foo:"bar"}; });
Let me know if this does not help you.
source share