From this question: fooobar.com/questions/275915 / ...
https://twitter.com/[screen_name]/profile_image?size=mini https://twitter.com/[screen_name]/profile_image?size=normal https://twitter.com/[screen_name]/profile_image?size=bigger https://twitter.com/[screen_name]/profile_image?size=original
function ClickFunction() { document.getElementById("content").innerHTML = ""; var frag = document.createDocumentFragment(); var uname = document.getElementById("name").value; var SRCmini = "https://twitter.com/" + uname + "/profile_image?size=mini"; var SRCnormal = "https://twitter.com/" + uname + "/profile_image?size=normal"; var SRCbigger = "https://twitter.com/" + uname + "/profile_image?size=bigger"; var SRCoriginal = "https://twitter.com/" + uname + "/profile_image?size=original"; frag.appendChild(document.createTextNode(SRCmini)); frag.appendChild(document.createElement("br")); var IMGmini = frag.appendChild(document.createElement("img")); IMGmini.src = SRCmini; frag.appendChild(document.createElement("br")); frag.appendChild(document.createTextNode(SRCnormal)); frag.appendChild(document.createElement("br")); var IMGnormal = frag.appendChild(document.createElement("img")); IMGnormal.src = SRCnormal; frag.appendChild(document.createElement("br")); frag.appendChild(document.createTextNode(SRCbigger)); frag.appendChild(document.createElement("br")); var IMGbigger = frag.appendChild(document.createElement("img")); IMGbigger.src = SRCbigger; frag.appendChild(document.createElement("br")); frag.appendChild(document.createTextNode(SRCoriginal)); frag.appendChild(document.createElement("br")); var IMGoriginal = frag.appendChild(document.createElement("img")); IMGoriginal.src = SRCoriginal; frag.appendChild(document.createElement("br")); document.getElementById("content").appendChild(frag); }
<input id="name" value="wikipedia" /><br /> <button onclick="ClickFunction()">Click here!</button><br /><br /> <div id="content"></div>
source share