Hello Team,
I am trying to make use of the SurveyJS Form Library integration with HTML/CSS/JS, but I am getting the ReferenceError: Survey is not defined. I can confirm that the link resources (survey-core and survey-js-ui) needed for this to work is correctly loaded (I can see them loaded in the Sources of the page).
The following is the script tag I am using:
HTML<script>
const surveyJson = {
elements: [{
name: "FirstName",
title: "Enter your first name:",
type: "text"
}, {
name: "LastName",
title: "Enter your last name:",
type: "text"
}]
};
try {
const survey = new Survey.Model(surveyJson);
$(function() {
// Render the survey inside the page
$("#surveyContainer").Survey({ model: survey });
// Render the survey in a pop-up window
$("#surveyContainer").PopupSurvey({ model: survey, isExpanded: true });
});
} catch (e) {
console.log(e)
}
</script>
This is the code from the documentation which I was trying to test but I can't seem to understand why I am getting a ReferenceError. Any suggestion on how to fix this would be appreciated.