sendResponse
If you want to submit the contribution, call the created function (given by the value of the sendResponse param).
Note: Use onProgress and onEnd to hook into contribution progress, and onError to hook into warnings or errors.
frame.src='panel-response.plotto.com/landing/.../...?sendResponse=contributeToPlotto' //after the iframe loads, you can call this function contributeToPlotto();
You can show user feedback using the callback function. When the callback function is called with a string, it means the response was not sent, and the string param is the error message you can use to display custom feedback. Eg - if there is no file uploaded or no video recorded, the function will be called with an appropriate message.
If a contribution can be created, your callback will be called with true
NOTE: Creating the contribution is an async task. After your callback returns, the contribution is not ready yet. Use onProgress and onEnd to hook into contribution progress, and onError to hook into warnings or errors.
onProgress
frame.src= '.....?sendResponse=x&onProgress=onPlottoProgress' // you need to implement this function in order to get feedback on upload progress window.onPlottoProgress = function(progress){ //display the progress to the user alert(progress + '% done') }
onError
frame.src= '.....?sendResponse=x&onError=showPlottoError' // you need to implement this function in order to get feedback on errors window.showPlottoError = function(error){ //display the error to the user alert(error) }