success: function()

in src/AIHub/wwwroot/js/ui/formanalyzer.js [19:40]


    success: function (file, response) {
        if (typeof response === "object") {        
            $("#show-message-result").text(response.message);

            var ifrm = document.createElement("iframe");
            ifrm.setAttribute("src", response.pdfUrl);
            document.getElementById("pdf-frame").appendChild(ifrm);
        } else {
            try {
                var parsedResponse = JSON.parse(response);
                $("#show-message-result").val(parsedResponse.message);

                var ifrm = document.createElement("iframe");
                ifrm.setAttribute("src", response.pdfUrl);
                document.getElementById("pdf-frame").appendChild(ifrm);
            } catch (e) {
                console.error("Error parsing the response:", e);
            }
        }

        $("#showresult").removeClass("d-none");
    },