$(document).ready() || setTimeout?
<p>I have code (not necessary for the question) which needs to be executed after $(document).ready() <strong>or</strong> if the window is loaded for let's say 5 seconds. </p>

<p>I tried to figure it out, but I couldn't find anything on the web. Hope someone here can help me!</p>

<p>(I know how to do it separate like in 2 statements, but I need to put it in a OR statement.)</p>

<p>Edit: To make it more clear for people. Either <strong>wait</strong> till the document is ready aka dom is builded <strong>OR</strong> if after 5 seconds the document still isn't ready BUT the window is loaded, just execute the function.</p>