Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

javascript - I am having trouble with formatting my html code


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Use template literals

var cell = `
<div class="col-md-10" style="float: none; margin: 0 auto;">
  <h3><span>${name}</span></h3>                                                                           
  <div class="flip-container">                                                                           
    <div class="flipper">                                                                                 
      <div class="front">
        <a id="restaurants" href="#" data-toggle="modal" data-target="#movieModal" item="${count}">
          <img class="img-fluid img-thumbnail" src="${rimg}" />
        </a>
      </div>
      <div class="back">
        <div class="bg-dark mystyle text-center py-3">
          <button data-toggle="modal" data-target="#movieModal" item="${count}" type="button" class="btn btn-primary btn-sm" onClick="showMovieDetails(this)">See More</button>
          <button data-toggle="modal" data-target="#commentModal" item="${count}" type="button" class="btn btn-primary btn-sm" onClick="showMovieComments(this)">Comments</button>
        </div>
      </div>
    </div>
  </div>                                                                                                   
</div>
`;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...