JSFiddle - React, Tailwind, and code Playground

by Iris Classon

JavaScript

$(function () {
                            if (navigator.userAgent.indexOf("illa") != -1) {
                                window.setInterval(function () {
                                    var object = JSON.stringify({ "id": "on" });
                                    
                                    var url = '@Url.Action("GetLatestQuestion", "Home")';
                                    $.ajax({
                                        url: url,
                                        type: 'POST',
                                        data: object,
                                        contentType: "application/json",
                                        success: function (newQ) {
                                            var q = newQ.Question;
                                            that.question(q);
                                            var a = newQ.Answers;
                                            that.alternatives.removeAll();
                                            $(a).each(function (key, value) {
                                                that.alternatives.push(value);
                                            });
                                        }
                                    });
                                }, 10000);
                            }
                        });