PageSourceSearch

https://www.ewii.dk/Static/SchemaMarkup/schema_markup.js?v-504911232000000000

js ewii.dk collected 2026-10-03 23:27:13 UTC 7,875 bytes, 221 lines download raw bytes

1function extractEmailAddress() {
2    var mailtoLinks = document.querySelectorAll('a[href^="mailto:"]');
3    if (mailtoLinks.length > 0) {
4        var mailtoLink = mailtoLinks[0].getAttribute("href");
5        var emailAddress = mailtoLink.replace("mailto:", "");
6        // Validate email address format
7        var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
8        if (emailRegex.test(emailAddress)) {
9            return emailAddress;
10        }
11    }
12    return null;
13}
14
15function generateBreadcrumbData() {
16    var url = window.location.href;
17    var domain = window.location.origin;
18    var path = url.replace(domain, ""); // Remove the domain part from the URL
19    var slugs = path.split("/").filter(function (slug) {
20        return slug !== "";
21    });
22
23    var breadcrumbList = [];
24    var breadcrumbData = {
25        "@context": "https://schema.org",
26        "@type": "BreadcrumbList",
27        itemListElement: [],
28    };
29
30    var homeItem = {
31        "@type": "ListItem",
32        position: 1,
33        name: "Home",
34        item: domain,
35    };
36
37    breadcrumbList.push(homeItem);
38    for (var i = 0; i < slugs.length; i++) {
39        var slug = slugs[i];
40        var position = i + 2;
41        var itemUrl = domain;
42
43        for (var j = 0; j <= i; j++) {
44            itemUrl += "/" + slugs[j];
45        }
46
47        var breadcrumbItem = {
48            "@type": "ListItem",
49            position: position,
50            name: capitalize(slug.replace(/-/g, " ")),
51            item: itemUrl + "/",
52        };
53
54        breadcrumbList.push(breadcrumbItem);
55    }
56
57    breadcrumbData.itemListElement = breadcrumbList;
58    return breadcrumbData;
59}
60
61function capitalize(str) {
62    return str.charAt(0).toUpperCase() + str.slice(1);
63}
64
65function hasEmailAddress() {
66    var mailtoLinks = document.querySelectorAll('a[href^="mailto:"]');
67    return mailtoLinks.length > 0;
68}
69
70var jsonLdData = generateBreadcrumbData();
71
72var mainSchema = {
73    "@context": "https://schema.org",
74    "@graph": [
75        {
76            "@type": "webpage",
77            "@id": window.location.href + "#webpage",
78            url: window.location.href,
79            breadcrumb: jsonLdData,
80            isPartOf: {
81                "@type": "website",
82                url: "https://www.ewii.dk/",
83                "@id": "https://www.ewii.dk/",
84                about: {
85                    "@id": "https://www.ewii.dk/#organization",
86                },
87                potentialAction: {
88                    "@type": "SearchAction",
89                    target: {
90                        "@type": "EntryPoint",
91                        urlTemplate: ["https://www.ewii.dk/?s={search_term_string}"],
92                    },
93                    "query-input": "required name=search_term_string",
94                    query: "search_term_string",
95                },
96                publisher: {
97                    "@id": "https://www.ewii.dk/#organization",
98                },
99            },
100        },
101        {
102            "@type": "LocalBusiness",
103            name: "EWII",
104            alternateName: "EWII",
105            url: "https://www.ewii.dk/",
106            logo: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20112%2050%22%3E%3Cg%20fill-rule%3D%22nonzero%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M7.64%2019L0%2050h26.94l1.96-7.928H11.907l.974-3.865h15.575l1.82-7.4H14.722l.974-3.865h16.93l1.968-7.929L7.64%2019zm62.581%200L62.05%2037.014h-.09L62.486%2019h-8.689l-8.26%2018.014h-.09L45.967%2019h-9.776l1.454%2031h9.601l7.483-16.062h.089L54.345%2050h9.601l16.415-31h-10.14zm12.688%200l-7.612%2031h9.944l7.599-30.993L82.91%2019zm15.068%200l-7.61%2031h9.945L108%2019.007%2097.977%2019z%22%20fill%3D%22%23232323%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M89.6%200c3.093%200%205.6%202.462%205.6%205.5S92.693%2011%2089.6%2011C86.507%2011%2084%208.538%2084%205.5S86.507%200%2089.6%200zm16.8%200c3.093%200%205.6%202.462%205.6%205.5s-2.507%205.5-5.6%205.5c-3.093%200-5.6-2.462-5.6-5.5s2.507-5.5%205.6-5.5z%22%20fill%3D%22%23FFF%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3C%2Fsvg%3E",
107            "@id": "https://www.ewii.dk/#organization",
108            openinghours: ["Mo-Th 08:30-15:30", "Fr 08:30-14:30"],
109            telephone: "70 50 50 50",
110            image:
111                "https://www.ewii.dk/globalassets/mediebibliotek/5.-om-ewii/1.-organisation/1600x1200/ewii-pa-taget.jpg?width=1600&height=1200&mode=crop",
112            address: {
113                "@type": "PostalAddress",
114                addressCountry: "DK",
115                addressLocality: "Kolding",
116                addressRegion: "Kolding",
117                postalCode: "6000",
118                streetAddress: "Kokbjerg 30",
119            },
120            contactPoint: {
121                "@type": "ContactPoint",
122                contactType: "customer service",
123                url: "https://www.ewii.dk/privat/kundeservice/kontakt/",
124                telephone: "70 50 50 50",
125                email: hasEmailAddress() ? extractEmailAddress() : "",
126                hoursAvailable: ["Mo-Th 08:30-15:30", "Fr 08:30-14:30"],
127            },
128            geo: {
129                "@type": "GeoCoordinates",
130                latitude: "55.538540023018875",
131                longitude: "9.48631490879599",
132            },
133            areaServed: "DK",
134            aggregateRating: {
135                "@type": "AggregateRating",
136                ratingValue: "4.1",
137                reviewCount: "5270",
138            },
139            sameAs: [
140                "https://dk.trustpilot.com/review/ewii.dk",
141                "https://www.facebook.com/EWIIkoncern",
142                "https://www.linkedin.com/company/ewii/",
143                "https://www.youtube.com/user/TreForDanmark",
144            ],
145            hasMap: "https://maps.app.goo.gl/quwt2iR4RCL431FR6",
146        },
147    ],
148};
149
150(function () {
151    document.addEventListener(
152        "DOMContentLoaded",
153
154        function () {
155            const panels = document.querySelectorAll(
156                ".ewii-accordion-component__panel"
157            );
158
159            if (!panels || panels.length === 0) return;
160
161            const headers = document.querySelectorAll(
162                ".ewii-accordion-component__header button"
163            );
164
165            const contents = document.querySelectorAll(
166                ".ewii-accordion-component__content"
167            );
168
169            const count = Math.min(
170                panels.length,
171
172                headers.length,
173
174                contents.length
175            );
176
177            if (count === 0) return;
178
179            const data = {
180                "@context": "https://schema.org",
181
182                "@type": "FAQPage",
183
184                mainEntity: [],
185            };
186
187            for (let i = 0; i < count; i++) {
188                const question = (headers[i].innerText || "").trim();
189
190                const answer = (contents[i].innerText || "").trim();
191
192                if (question && answer) {
193                    data.mainEntity.push({
194                        "@type": "Question",
195
196                        name: question,
197
198                        acceptedAnswer: {
199                            "@type": "Answer",
200                            text: answer,
201                        },
202                    });
203                }
204            }
205            if (data.mainEntity.length > 0) {
206                const script = document.createElement("script");
207                script.type = "application/ld+json";
208
209                script.textContent = JSON.stringify(data);
210                document.head.appendChild(script);
211                // optional for debugging
212                // console.log('FAQ JSON-LD appended:', data);
213            }
214        }
215    );
216})();
217
218var script = document.createElement("script");
219script.type = "application/ld+json";
220script.innerHTML = JSON.stringify(mainSchema);
221document.getElementsByTagName("head")[0].appendChild(script);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.