I am making a website that takes URL parameters and then creates meta tags accordingly from them. Discord is not displaying any embed.
Here is the code:
<!DOCTYPE html>
<html>
<script>
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
}
var title = getUrlVars()["title"];
var description = getUrlVars()["desc"];
var color = getUrlVars()["color"];
var td = document.createElement("meta");
var tt = document.createElement("meta");
var tc = document.createElement("meta");
td.setAttribute("content", description);
tt.setAttribute("content", title);
tc.setAttribute("content", color);
td.setAttribute("property", "og:description");
tt.setAttribute("property", "og:title");
tc.setAttribute("name", "theme-color");
document.head.appendChild(td);
document.head.appendChild(tt);
document.head.appendChild(tc);
</script>
</html>
As you can see, no embed showed up. I am relatively new to HTML and DOM, so all help is appreciated.