Image isn't loaded

Please run the following JavaScript code in console and you would probably see that the image isn’t loaded.

document.body.insertAdjacentHTML('beforeend', `
	<aside class="cbwtphone_wrapper">
		<a class="cbwtphone_link" href="https://wa.me:NUMBER">
			<span class="cbwtphone_text">WhatsApp call</span>
			<img class="cbwtphone_icon" src="https://en.wikipedia.org/wiki/WhatsApp#/media/File:WhatsApp.svg"></img>
		</a>
	</aside>
`)

https://en.wikipedia.org/wiki/WhatsApp#/media/File:WhatsApp.svg is not a direct link. File: appears to be a parameter for a redirect.

The actual image is here https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg

Change your url to that and it does load the image, albeit a huge one.

3 Likes

The SVG file is only 2501 bytes.

1 Like

Scalable Vector Graphics, I guess it is in the name. My error.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.