{"id":65506,"date":"2026-11-25T19:15:26","date_gmt":"2026-11-25T18:15:26","guid":{"rendered":"https:\/\/amit-automation.cz\/podpora\/casto-kladene-otazky\/amit-designer-napoveda\/div-type\/"},"modified":"2026-11-25T19:15:26","modified_gmt":"2026-11-25T18:15:26","slug":"div-type","status":"publish","type":"napoveda","link":"https:\/\/amit-automation.cz\/en\/support\/faq\/amit-designer-help\/div-type\/","title":{"rendered":"DIV type"},"content":{"rendered":"<p style=\"text-align: justify;\">The <em>Active Area<\/em> element can also work as a placeholder for your web component. In the runtime, <em>mySCADA<\/em> will create an empty DIV component in the location and size of your active area. This DIV component can be manipulated in <em>View Scripts<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/myscada.org\/downloads\/manuals_image\/img_9.5.1.jpg\" alt=\"9.5.1\" width=\"300\" height=\"113\" \/><\/p>\n<p style=\"text-align: justify;\">Select <em>HTML -&gt; Div Element<\/em>. Fill in the <em>ID<\/em> of your DIV (active area) component. With this <em>ID<\/em> you can access your component in the <em>View Scripts<\/em> using the function<\/p>\n<pre><span style=\"color: #0084c8;\">document.getElementById (\"ID\")<\/span><\/pre>\n<h3><span style=\"color: #4baddd;\">Example<\/span><\/h3>\n<p style=\"text-align: justify;\">In the following example, we will use the <em>Active Area<\/em> to display a <em>Google<\/em> map. First of all, create a view and insert it into the active area. Then set the type to <em>HTML -&gt; Div Element<\/em> in the <em>Init Value<\/em>. Type in \u2018googlemap\u2019 into the <em>ID type<\/em> field.<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/myscada.org\/downloads\/manuals_image\/img_9.5.2.jpg\" alt=\"9.5.2\" width=\"600\" height=\"541\" \/><\/p>\n<p style=\"text-align: justify;\">Now all we need to do is to initialize the <em>DIV<\/em> element with <em>Google<\/em> maps. This can be done in <em>View Scripts<\/em>. Open the view script and enter the code for initialization into the <em>Init function<\/em> field.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/myscada.org\/downloads\/manuals_image\/img_9.5.3.jpg\" alt=\"9.5.3\" width=\"600\" height=\"488\" \/><\/p>\n<p style=\"text-align: justify;\">There are two interesting parts in this code:<\/p>\n<p style=\"text-align: justify;\">1. This part dynamically loads external <em>JavaScript<\/em> from the Internet &#8211; in our case Google map API:<\/p>\n<pre style=\"text-align: justify;\"><span style=\"color: #0084c8;\">var script = document.createElement('script'); \/\/create script element<\/span>\r\n<span style=\"color: #0084c8;\">script.src = \"http:\/\/maps.google.com\/maps\/api\/js?sensor=true&amp;callback=gmap_draw\"; \/\/url to the script<\/span>\r\n<span style=\"color: #0084c8;\">document.head.appendChild(script);\u00a0 \/\/load and append js<\/span><\/pre>\n<p style=\"text-align: justify;\">2. This piece of code will find our DIV element (e.g. Active area) with googlemap id<\/p>\n<pre style=\"text-align: justify;\"><span style=\"color: #0084c8;\">document.getElementById(\"googlemap\")<\/span><\/pre>\n<p style=\"text-align: justify;\">3. And finally the result:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/myscada.org\/downloads\/manuals_image\/img_9.5.4.jpg\" alt=\"9.5.4\" width=\"700\" height=\"470\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"menu_order":54,"template":"","class_list":["post-65506","napoveda","type-napoveda","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/amit-automation.cz\/en\/wp-json\/wp\/v2\/napoveda\/65506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/amit-automation.cz\/en\/wp-json\/wp\/v2\/napoveda"}],"about":[{"href":"https:\/\/amit-automation.cz\/en\/wp-json\/wp\/v2\/types\/napoveda"}],"version-history":[{"count":0,"href":"https:\/\/amit-automation.cz\/en\/wp-json\/wp\/v2\/napoveda\/65506\/revisions"}],"wp:attachment":[{"href":"https:\/\/amit-automation.cz\/en\/wp-json\/wp\/v2\/media?parent=65506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}