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

Content deleted Content added
No edit summary
Prevent XSS attack using .textContent
 
(10 intermediate revisions by the same user not shown)
Line 48:
<script>
const urlParams = new URLSearchParams(window.location.search);
ifconst firstName = (urlParams.hasget("fname")){;
if (firstName){
document.getElementById('donor-greeting').innerHTML = `${urlParams.get("fname")}, s`;
if(firstName !== 'Wikimedia Supporter'){
const capitalizedName = firstName.charAt(0).toUpperCase() + firstName.slice(1); //Capitalize name
document.getElementById('donor-greeting').innerHTMLtextContent = `${urlParams.get("fname")capitalizedName}, s`;
}
}
</script>