{"id":19507,"date":"2024-09-23T14:18:50","date_gmt":"2024-09-23T12:18:50","guid":{"rendered":"https:\/\/sc.informatik.rwth-aachen.de\/?page_id=19507"},"modified":"2024-09-23T14:44:52","modified_gmt":"2024-09-23T12:44:52","slug":"elementor-19507","status":"publish","type":"page","link":"https:\/\/sc.informatik.rwth-aachen.de\/en\/elementor-19507\/","title":{"rendered":"Elementor #19507"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"19507\" class=\"elementor elementor-19507\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-adb3f78 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"adb3f78\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-96f790d\" data-id=\"96f790d\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-20e7fe3 elementor-widget elementor-widget-html\" data-id=\"20e7fe3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<script>\n    \njQuery(document).ready(function($) {\n    $('#mySelect2_studycourse').select2({\n        ajax: {\n            url: ajax_object.ajax_url,\n            dataType: 'json',\n            data: function(params) {\n                return {\n                    q: params.term, \/\/ search term\n                    action: 'get_select2_data' \/\/ AJAX action\n                };\n            },\n            processResults: function(data) {\n                return {\n                    results: $.map(data, function(item) {\n                        return {\n                            id: item.id,\n                            text: item.text\n                        };\n                    })\n                };\n            }\n        }\n    });\n\t\n    \/\/ Handle form submission\n    $('#myForm').on('submit', function(e) {\n        alert(1);\n        e.preventDefault();\n\t\tvar formData = $(this).serialize();\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajax_object.ajax_url,\n\t\t\tdata: {\n\t\t\t\taction: \"myajaxurl\",\n\t\t\t\tdata: $(\"#mySelect2_studycourse\").val(),\n\t\t\t},\n\t\t\tsuccess: function(response) {\n                $('#responseContainer').html(response);\n            },\n\t\t\tdataType: \"html\"\n\t\t});\n\t\n\t});\n\n});\n\nfunction myajaxurl(e) {\n    e.preventDefault();\n    alert(e);\n    \n    fetch('https:\/\/jsonplaceholder.typicode.com\/todos\/1')\n      .then(response => response.json())\n      .then(json => console.log(json))\n\t\/\/ var formData = $(this).serialize();\n\t\/\/ fetch\n}\n\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-48b3958 elementor-widget elementor-widget-html\" data-id=\"48b3958\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<form id=\"myForm\" onsubmit=\"return myajaxurl(event)\" action=\"\">\n    <select id=\"mySelect2_studycourse\" name=\"my_select\" style=\"width: 100%\"><\/select>\n    <input type=\"submit\" value=\"Submit\">\n<input type=\"hidden\" name=\"trp-form-language\" value=\"en\"\/><\/form>\n<div id=\"responseContainer\"><\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-30faaaa elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"30faaaa\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-69bc576\" data-id=\"69bc576\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":15,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"footnotes":""},"class_list":["post-19507","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sc.informatik.rwth-aachen.de\/en\/wp-json\/wp\/v2\/pages\/19507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sc.informatik.rwth-aachen.de\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sc.informatik.rwth-aachen.de\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sc.informatik.rwth-aachen.de\/en\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/sc.informatik.rwth-aachen.de\/en\/wp-json\/wp\/v2\/comments?post=19507"}],"version-history":[{"count":25,"href":"https:\/\/sc.informatik.rwth-aachen.de\/en\/wp-json\/wp\/v2\/pages\/19507\/revisions"}],"predecessor-version":[{"id":19545,"href":"https:\/\/sc.informatik.rwth-aachen.de\/en\/wp-json\/wp\/v2\/pages\/19507\/revisions\/19545"}],"wp:attachment":[{"href":"https:\/\/sc.informatik.rwth-aachen.de\/en\/wp-json\/wp\/v2\/media?parent=19507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}