Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用SurveyJS,但我是本文档的新手。
SurveyJS
在survey.js 中,您需要在开始调查之前提供一次选项和问题的json。
但我的要求是当用户点击下一个按钮时对每个问题进行 api 调用
如果我正确理解您的问题,您可以使用以下代码遍历所有问题:
var json = { /* survey JSON */ }; var survey = new Survey.Model(json); survey.getAllQuestions().forEach(function(question) { // work with question here // question.<property name> });