# Can I specify random logos?

**URL:** <https://meta.discourse.org/t/can-i-specify-random-logos/39339>\
**Category:** Product Support\
**Created:** [10 בפברואר,‏ 2016,‏ 2:39pm UTC](https://meta.discourse.org/t/can-i-specify-random-logos/39339 "2016-02-10T14:39:07Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Gunnar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gunnar/32/119647_2.png) [@Gunnar](https://meta.discourse.org/u/Gunnar)\
**Post date:** [10 ביוני,‏ 2021,‏ 4:52am UTC](https://meta.discourse.org/t/can-i-specify-random-logos/39339/7 "2021-06-10T04:52:39Z")

</div>

> [@sam](#):
>
> a custom ember initializer instead that overrides the URL in discourse

Sam,

I’ve run up against the same problem. `window.onload` works if called before `</head>`, but not if called later. And because of that, `document.getElementById` fails (the ID isn’t defined yet).

Could you point me to a primer/example/howto for how to create a custom ember initializer for someone who has no experience with ember?

For completeness, what I’m trying to do is display a random banner image from an array of URLs:

```plaintext
var jlmyPix = new Array(
     '/img/pic0.jpeg',
     [...]
     '/img/picN.jpeg'
);

function jlchoosePic() {
     var jlrandomPicNum = Math.floor(Math.random() * jlmyPix.length);
     document.getElementById("jlmyPicture").src = jlmyPix[jlrandomPicNum];
};

window.onload = jlchoosePic;

```

---

_[View the full topic](https://meta.discourse.org/t/can-i-specify-random-logos/39339)._
