title: OnError image handling within php echo
body: <p>Im trying to handle 404 images pulled from omdbapi.com, but my code is not working. I am looping through an array to build a movie list. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>echo '&lt;a href="'.$oIMDB-&gt;getUrl().'" target="_new"&gt;&lt;img class="img-responsive img-thumbnail posterImage" onError=\"this.onError=null;this.src='error.png'; this.onclick=null;\" src="https://img.omdbapi.com/?i=' . $user['imdbID'] . '&amp;apikey=secret" height="300"&gt;&lt;/a&gt;';</code></pre>
  </div>
  </div>
  </p>
  
  <p>When I inspect the code in Chrome, it looks like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;img class="img-responsive img-thumbnail posterImage" this.onclick="null;\&amp;quot;" height="300" data-pagespeed-url-hash="282594047" src="https://img.omdbapi.com/?i=tt5898034&amp;amp;apikey=secret" onerror="this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);" data-pagespeed-lazy-replaced-functions="1"&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>First, I thought the issue was with the single/double quotes inside the echo, but then I saw lazyload appearing in the middle of the onerror.</p>
  
  <p>Is lazyload causing the issue somehow? I haven't deliberately included lazyload on my pages. Maybe it's on by default when jQuery is included?</p>
  
  <p>Any input will be much appreciated!</p>