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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:35:15+00:00 2026-05-23T07:35:15+00:00

I current have the following which works well: channel.bind(‘pusher:subscription_succeeded’, function(members) { members.each(set_status_online); }) function

  • 0

I current have the following which works well:

channel.bind('pusher:subscription_succeeded', function(members) {
    members.each(set_status_online);
})


function set_status_online(member) {
    var user_temp;
    user_temp = findWallUser(member.info.uid);
    if (user_temp) {
        user_temp.status('online');
    }
    else {
        console.log('user not found');
    }
}

I am trying to update the first part to give me more control of the members.each. I want something like this:

channel.bind('pusher:subscription_succeeded', function(members) {
    members.each {
       set_status('online');
    }
})

Is there a way I can do that with the array & .each? 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-23T07:35:15+00:00Added an answer on May 23, 2026 at 7:35 am

    With arrays, use $.each like this:

    $.each(members,set_status_online);
    

    Change your function to have the index as the first variable:

    function set_status_online(index,member) {
    etc...
    }
    

    Or if you don’t want to modify your function, you can do this with the $.each:

    $.each(members,function(i,e){
      set_status_online(e)
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following function that deletes the LaTeX command surrounding the current cursor
At my current place of work we have to use a web-service which works
I have the following evaluation which works great: In my listings/detail.html.erb view <% if
I have the following hover script which works on my nav link images: $(nav
In my current repo I have the following output: $ git branch -a *
I have the following rule in my current .htaccess file to redirect /videos/login/ requests
I have the following JQuery statement and it is adding the class 'current' but
I have the following Nav: <li id=categories> <ul> <li class=cat-item cat-item-8 current-cat><a href=#>Link</a> <ul>
I have used the following statements to get the current time. print $query executed
I have been given the following request. Please give 7% of the current contacts

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.