uncaught typeerror t is not a function
This error only happened when I load the survey in a modal window. I've search a bit and this is seem to be reactjs error. Is there any possibilities that a same function name is used in react too?
uncaught typeerror t is not a function
This error only happened when I load the survey in a modal window. I've search a bit and this is seem to be reactjs error. Is there any possibilities that a same function name is used in react too?
Hello,
It is impossible to say what is going on without seeing the code. Could you create a plunker example that produces this issue?
Thank you,
Andrew
SurveyJS Team
Hi Andrew, sorry I’ve solve the issue. The problem was I’m using the JS and PHP curl to submit the result. Well the curl override the JS onComplete function, thus triggering the error.
My sample code:
JavaScriptvar surveyJSON = {
surveyId: 'your-survey-id'
}
survey = new Survey.Model(surveyJSON);
survey.surveyPostId = 'another-survey-id';
function sendDataToServer() {
var resultAsString = JSON.stringify(survey.data);
$.ajax({
type: "POST",
url: "process-questionnaire.php",
data: {
"status": 'completed',
"data": resultAsString
},
success: function(msg) {
alert("Thanks for participating.");
$('#myModal').hide();
}
});
}
$("#surveyContainer").Survey({
model: survey,
onComplete: sendDataToServer
});
I can't see anything wrong in your code.
Could you please try the latest version of SurveyJS. We are using a knockout version for jQuery now, instead of react/preact in the previous.
Thank you,
Andrew
SurveyJS Team