Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing "Back" button on browser messes up jquery.shorten #44

Open
Naokimi opened this issue Apr 12, 2021 · 0 comments
Open

Pressing "Back" button on browser messes up jquery.shorten #44

Naokimi opened this issue Apr 12, 2021 · 0 comments

Comments

@Naokimi
Copy link

Naokimi commented Apr 12, 2021

I'm on a page that uses jquery.shorten. The HTML in place is as follows:

<div class="listing__content" data-shorten="150">
  <div class="shortcontent">
    <p style="margin-bottom: 0px;">Pikachu is a main character in the Magical Pokémon Journey manga series. He is described as rather scatterbrained, doesn't speak human language, but t<span class="ellip">...</span></p>
  </div>
  <div class="allcontent" style="display: none;">
    <p>Pikachu is a main character in the Magical Pokémon Journey manga series. He is described as rather scatterbrained, doesn't speak human language, but the others seem to understand him.</p>
  </div>
  <span><a href="javascript://nop/" class="morelink">Show More</a></span>
</div>

I go to another page, then press "back" button my browser to return to the page with jquery.shorten and the HTML is messed up (concretely, it gets nested):

<div class="listing__content" data-shorten="150">
  <div class="shortcontent">
    <div class="shortcontent">
      <p style="margin-bottom: 0px;">Pikachu is a main character in the Magical Pokémon Journey manga series. He is described as rather scatterbrained, doesn't speak human language, but <span class="ellip">...</span></p>
    </div>
  </div>
  <div class="allcontent" style="display: none;">
    <div class="shortcontent">
      <p style="margin-bottom: 0px;">Pikachu is a main character in the Magical Pokémon Journey manga series. He is described as rather scatterbrained, doesn't speak human language, but t<span class="ellip">...</span></p>
    </div>
    <div class="allcontent" style="display: none;">
      <p>Pikachu is a main character in the Magical Pokémon Journey manga series. He is described as rather scatterbrained, doesn't speak human language, but the others seem to understand him.</p>
    </div>
    <span><a href="javascript://nop/" class="morelink">Show More</a></span>
  </div>
  <span><a href="javascript://nop/" class="morelink">Show More</a></span>
</div>

Repeating the steps above further nest the HTML

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant