Alert not showing when using load() method on image
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$('#rafale').load(function (){    
    alert('hello');
});</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;&lt;/script&gt;

&lt;img id="rafale" src="https://signup.na.leagueoflegends.com/theme/signup_new_theme/img/logo-lol.png" alt="Rafale Jet" &gt;</code></pre>
</div>
</div>
</p>

<p>The above code is for showing an <code>alert</code> box after loading the image but it is not showing. Instead it's giving an error:</p>

<blockquote>
  <p>jquery-3.1.1.min.js:4 Uncaught TypeError: a.indexOf is not a> function(…)</p>
</blockquote>