async function Load() {
    const articalId = window.location.href.split("?view=")[1];
    $("#TravelBackToArtical").on("click", function() {
        Link("/artical?view=" + articalId);
    });
    $("#SaveChanges").on("click", function() {
        //saves
    });
    await $.ajax({
        url: "/universal/get_articals/id/" + articalId,
        method: "GET",
        success: async function(response) {
            let sectionArray = [];
            let str = String(JSON.parse(response[0].sections).sections);
            let sendingString = "";
            for (let _ = 0; _ < str.length; _++) {
                if (str[_] == ",") {
                    sendingString += "-";
                }
                else {
                    sendingString += str[_];
                }
            }
            await $.ajax({
                url: "/sections/" + sendingString,
                method: "GET",
                success: function(answer) {
                    sectionArray = answer;
                },
                error: function(answer) {
                    console.log(answer.responseJSON);
                }
            });
            await $.ajax({
                url: "/universal/get_topics/id/" + response[0].topic_id,
                method: "GET",
                success: function(answer) {
                    $("#TravelToTopicPage").on("click", function() {
                        Link("/topic?view=" + answer[0].name);
                    });
                    $("#TopicTitle").html("Topic: " + answer[0].name);
                },
                error: function(answer) {
                    console.log(answer.responseJSON);
                }
            });
            $("#ArticalTitle").val("Artical: " + response[0].name);
            $("#ArticalDescription").html(response[0].description);
            for (let _ = 0; _ < sectionArray.length; _++) {
                // sataisi šo
                $("#ArticalSections").append("<div id=\"section" + _ + "\"><input value=\"" + sectionArray[_].title + "\"><br><textarea value=\"" + sectionArray[_].body + "\"></textarea></div><hr>");
            }
        },
        error: function(response) {
            console.log(response.responseJSON);
        }
    });
}