Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6059039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:39:59+00:00 2026-05-23T08:39:59+00:00

I have this Chrome Extension, it adds a poke all button under your pokes.

  • 0

I have this Chrome Extension, it adds a poke all button under your pokes. I am trying to update it so when you have 6 pokes or more, the “Show All (6)” makes it refresh My poke all button. [because it disappears when you click on the “Show all (6)”]. So in my code this is how I add the button:

$("#pagelet_pokes a:last").after(html_code)

so in facebook there is a div with the id=”pagelet_pokes”, it has tons of sub divs, and eventually there is a div w/ class=’phs’, with a , and in that list are the poke links.

So to simplify:

<div id='pagelet_pokes'>
...
<div class='phs'>
<ul>
<li><div><div><a href>Poke #1</a></div></div></li>
<li><div><div><a href>Poke #2</a></div></div></li>
</div>
</div>

So jQuery adds my button, after the last . That works fine.

The problem is, the “Show all (6)” adds another <li> at the bottom, and when clicked, it hides itself instead of removing it [display=none]. so after the above code, it adds:

<li class='showAll'>
<a href='#'>
<span class='fwb'>Show all (6)</span>
</a>
</li>

Now, I tried changing my code in my javascript to this:

 $("#pagelet_pokes a:last").not('.showAll').after(html_code)

It did not work, because, the first selector selects all the <a>s, then discards any a’s that have .showAll, but that doesn’t help because the .showAll is in a child node!

So my question boils down to this.. How do I select the last “a” within #pagelet_pokes, that does not have a child span with the class “pokeAll”? Is there some “!” selector that might work like this? : $('#pagelet_pokes !li.showAll a:last')? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:39:59+00:00Added an answer on May 23, 2026 at 8:39 am

    Use the not-selector[docs].

    $('#pagelet_pokes li:not(.showAll) a:last')
    

    Or to make your selector valid for querySelectorAll (used internally when possible):

    $('#pagelet_pokes li:not(.showAll) a').last()
    

    EDIT:

    I can’t quite tell from the question, but if that last li that you want to exclude is always there, then I’d be inclined to keep the selector simple, and use the slice()[docs] method on the result:

    $('#pagelet_pokes li a').slice(0, -1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.