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 7976295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:52:47+00:00 2026-06-04T08:52:47+00:00

Imagine that we have some divs like that <div class=row chapter node=1>Chapter 1</div> <div

  • 0

Imagine that we have some divs like that

<div class="row chapter" node="1">Chapter 1</div>
<div class="row section" node="1">Section 1</div>

Ajax accepts array of nodes that must be deleted. I got few questions about this

1) I’m using following function

                $.each(result['nodes'], function(column, node)){
                   $(".row."+column).slideUp("slow").remove();
                }

I can’t figure out how to delete by 2 classes and node atribute. How to do that?

2) AFAIK $.each function deletes one by one. Is it possible to delete all at once?
3) How to deal with validation issues? I mean,

  • 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-06-04T08:52:48+00:00Added an answer on June 4, 2026 at 8:52 am

    Since an object only has key-value pairs, in order to handle two classes and one attribute, you’ll have to change the structure of your JSON. I suggest changing it to [{“class1″:”foo”,”class2″:”bar”,”node”:1}]. With that format, this will work to collect the nodes:

    $($.map(result['nodes'], function(o) {
        return "."+o.class1+"."+o.class2+"[node="+o.node+"]";
    }).join(","))
    

    As Joseph stated, your original code will remove the nodes too soon, so you’ll need to put the remove() in a parameter to slideUp():

    $($.map(result['nodes'], function(o) {
        return "."+o.class1+"."+o.class2+"[node="+o.node+"]";
    }).join(",")).slideUp("slow", function() {
        $(this).remove()
    });
    

    Sample jsFiddle: http://jsfiddle.net/tSu8z/

    Note that there’s really no “one by one” vs. “all at once” distinction. With the code above, jQuery gets the order to slide the nodes up all at once, but internally it will iterate through the nodes. Likewise, the nodes will most likely all appear to be deleted simultaneously, but jQuery is actually iterating through them. The only requirement for it to look simultaneous is for slideUp to be asynchronous, which it is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine that you have some text like this: Asdf I want the 'A' to
Imagine you have an entity that has some relations with other entities and you
Imagine that I have a nice Deck class, in the best OO fashion. It
Imagine that i have the following code: <a:repeat value=#{bean.getList()} var=x > <li class=la> <span>
Let's imagine that I have a result of evaluating XPath expression //node/@*. MSXML6 returns
I have a case here that I would like to have some opinions from
Imagine that you have some polygon on the center of the screen (let's say
I have some anchors in HTML that have a class of attrs: <a href=#
Let's imagine that we have some piece of html with appended actions. var html
Scenario I have a Node.JS service (written using ExpressJS ) that accepts image uploads

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.