How to include a survey in a web page
I want to create a simple online survey application. I have created a backend in python that handles vote tracking, poll display, results display, and admin setup. However, if I wanted a third party to be able to include a survey on their website, what would be the recommended way to do this? I would like to be able to provide a little javascript to get to a third party webpage, but I cannot use javascript because that would require cross-domain access. What approach would provide an easy overall solution for third parties?
a source to share
IFrame is the simplest no problem solution if you want to allow postbacks.
Or is it a bit left field and oldschool, but can you use a transparent gif 1x1 like your voice? They click on a link (radio / span / whatever), you set the src of the image to whatever lives on your server. Sort of
document.getElementById('voteImage').src='http://your.server/vote.html?pollidentifier=123&vote=4'
where vote.html is your backend code to handle the vote, the poll id is a way to tell what poll it is and vote is the vote they have chosen. All vote.html has to do is return something that smells like an image and the browser will be happy. Obviously you will need to put the stuff in place to keep people from spoofing voices, but the image + cookie is what the old timers were using before the new fandangled xhr came along.
a source to share