需要帮助扰乱我的代码。不是因为理由。 这是我的代码;
<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"/>
我觉得这很令人不安
<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>
结果应该是;
<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"/>