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

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