Banner space[article middle]
Code Test
Uncategorized
2. Nov 2023
124 views
Img test tiny

just a test code:
<script>
function generateSitemap() {
// Get the URLs from the textarea
const urlsTextarea = document.getElementById('urls');
const urls = urlsTextarea.value.trim().split('\n');
// Generate the XML sitemap
const xmlSitemap = generateXmlSitemap(urls);
// Display the result
const resultElement = document.getElementById('result');
resultElement.textContent = xmlSitemap;
}
function generateXmlSitemap(urls) {
// Create a new XML document
const xmlDoc = document.implementation.createDocument(null, 'urlset', null);
xmlDoc.documentElement.setAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
// Loop through each URL and create a <url> element
for (const url of urls) {
const urlElement = xmlDoc.createElement('url');
const locElement = xmlDoc.createElement('loc');
locElement.appendChild(xmlDoc.createTextNode(url));
urlElement.appendChild(locElement);
xmlDoc.documentElement.appendChild(urlElement);
}
// Serialize the XML document to a string
const serializer = new XMLSerializer();
const xmlString = serializer.serializeToString(xmlDoc);
return xmlString;
}
</script>
<!-- Inside the menu-drawer div in HTML -->
<div class="menu-icon">☰CCTEST</div> Add new comment
You must be logged in to add new comment. Log in
Search on blog
Banner space[side middle]
Most popular
Lately commented
demo comment ·
Hired people are awesome
comment to act on this ·
Hired people are awesome
tyyyrythertg ·
Scientists have discovered the cutes...
Hired people are awesome ·
Hired people are awesome
Hi! it is test comment ·
10 things you can learn about fashio...
good article ·
Take advantage of different weather ...

Comments