0

need help disturbs my code. Not because reason. This is my code;

<script>
theMovieDb.search.getMovie({"query":"{/literal} {$movie.title} {literal}"}, function(data) {
  var data = JSON.parse(data);
  var Rid = data.results[0];
  var background = Rid.backdrop_path;
var background = "https://image.tmdb.org/t/p/original" + Rid.backdrop_path;
document.getElementsByClassName("real")[0].dataset.original = background;

}, function(error){})
</script>

<img class="base" src="https://trakt.tv/assets/placeholders/thumb/fanart-32d9084d8b6cfeb49a9639b0a8a12af7.png" alt="Fanart"/>
<img class="real" src="https://trakt.tv/assets/placeholders/thumb/fanart-32d9084d8b6cfeb49a9639b0a8a12af7.png" alt="Fanart"/>

I see that so disturbs

<img class="base" alt="Fanart" src="https://trakt.tv/assets/placeholders/thumb/fanart-32d9084d8b6cfeb49a9639b0a8a12af7.png"><img class="real" alt="Fanart" src="https://trakt.tv/assets/placeholders/thumb/fanart-32d9084d8b6cfeb49a9639b0a8a12af7.png"> data-original="https://image.tmdb.org/t/p/original/uHeMMJIZRVjeS2WIFcxBCdCTdmk.jpg"</img>

And the result should be;

<img class="base" src="https://trakt.tv/assets/placeholders/thumb/fanart-32d9084d8b6cfeb49a9639b0a8a12af7.png" alt="Fanart"/><img class="real" data-original="https://image.tmdb.org/t/p/original/uHeMMJIZRVjeS2WIFcxBCdCTdmk.jpg" src="https://trakt.tv/assets/placeholders/thumb/fanart-32d9084d8b6cfeb49a9639b0a8a12af7.png" alt="Fanart"/>
Leo River
  • 1
  • 1
  • I still do not solve the problem, the code disturbs and because of this the picture is displayed. the solution is not given to me. – Leo River Oct 20 '15 at 14:07
  • There is nothing in your code that would explain why the HTML elements become corrupted. You'll have to show a *complete* example. – JJJ Oct 20 '15 at 14:15

0 Answers0