Add MonsterID.js to your site - KevinGaudin/monsterid.js GitHub Wiki
-
Download and add
monsterid.min.js
to your site.
-
In the
<head>
, add:<script type="text/javascript" src="monsterid.min.js"></script>
-
Now where ever you want to add a MonsterID, simply add:
<img id="thisMonster" class="avatar" />
(It is recommended to have an
id
because you will need to select that element later.) -
Now somewhere in your javascript, just add:
MonsterId.getAvatar("text", document.getElementById('thisMonster'));
-
You can also create one with the JS DOM instead:
var monster = document.createElement('img'); monster.className = "avatar"; document.body.appendChild(monster); MonsterId.getAvatar("text", monster);