Template:Appeal/FY2324 E3 XH/en: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
No edit summary
Prevent XSS attack using .textContent
 
(11 intermediate revisions by the same user not shown)
Line 42: Line 42:
<div class="appeal-layout">
<div class="appeal-layout">
<div class="appeal-text">
<div class="appeal-text">
<p class="headline">Support Wikipedia, your daily source of trusted knowledge.</p>
<p class="headline"><span id="donor-greeting">S</span>upport Wikipedia, your daily source of trusted knowledge.</p>
<p class="paragraph">Your support matters! Sustain this great fountain of knowledge built by people, for people. Keep Wikipedia thriving.</p>
<p class="paragraph">Your support matters! Sustain this great fountain of knowledge built by people, for people. Keep Wikipedia thriving.</p>
</div>
</div>
</div>
</div>
<script>
<script>
// Get the URL parameters from the current URL
const urlParams = new URLSearchParams(window.location.search);
const urlParams = new URLSearchParams(window.location.search);
const firstName = urlParams.get("fname");

if (firstName){
// Check if the "fname" parameter exists
if(firstName !== 'Wikimedia Supporter'){
if (urlParams.has("fname")) {
const capitalizedName = firstName.charAt(0).toUpperCase() + firstName.slice(1); //Capitalize name
// If it exists, assign its value to a variable
document.getElementById('donor-greeting').textContent = `${capitalizedName}, s`;
const fnameValue = urlParams.get("fname");
}
console.log("fname parameter exists, and its value is: " + fnameValue);
} else {
console.log("fname parameter does not exist in the URL.");
}
}
</script>
</script>

Latest revision as of 00:50, 4 November 2023

Support Wikipedia, your daily source of trusted knowledge.

Your support matters! Sustain this great fountain of knowledge built by people, for people. Keep Wikipedia thriving.