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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:10:10+00:00 2026-05-16T23:10:10+00:00

jQuery.each(player, function(key, val){ if (el = $(#pr_attr_plain_+key)){ el.text(val === ? 0 : + val);

  • 0
jQuery.each(player, function(key, val){                     
     if (el = $("#pr_attr_plain_"+key)){
          el.text(val === "" ? 0 : " " + val);
     }
});

I inherited a project and I came across something strange. The guy who started the project is an expereinced programmer, definitely more so then myself. Is there any value or reason (no matter how bad) in doing this:

if (el = $("#pr_attr_plain_"+key))

It works now and it’s in a portion of the code that I don’t have to touch. I don’t want to change it and have it produce unexpected consequences without knowing what it might do.

  • 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-16T23:10:10+00:00Added an answer on May 16, 2026 at 11:10 pm

    It can be correct.
    The code is equivalent to:

    jQuery.each(player, function(key, val){                     
         el = $("#pr_attr_plain_"+key);
         if (el){
              el.text(val === "" ? 0 : " " + val);
         }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function getDbValue() { alert($('[data-bind]').length); alert($('[data-bind][0].data-bind')); alert($('[data-bind][0].value')); jQuery.each($('[data-bind]'), function(databind,key) { alert(key); alert(databind); alert(databind[key].data-bind); }) }
jQuery(.single_writing).each(function(){ jQuery(this).click(function(){ jQuery(#thisTickets).val(); jQuery(#my_iframe).contents().find('.ticket_id').each(function(){ jQuery(this).click(function(){ if (jQuery(this).attr(checked)==true){ jQuery(#thisTickets).val(jQuery(#thisTickets).val()+jQuery(this).attr(id)+, ); } }); }); }) });
Inside the initialize() function there is a jQuery each loop. Inside that loop is
I am trying to use the jQuery each function (line 5) to display the
i found http://visualjquery.com/ more useful when i was learning jQuery with each function explained
For example: > function foo() { > jQuery(whatever).each( function() { return; // this just
Im using jquery and want each form text input to appear one by one,
I'm using a jQuery .each() call, which uses an anonymous function, from inside a
var positions = [ 00, 01, 02, 03, 04, 05 ]; jQuery.each( positions, function(players)
Jquery Each Json Values Issue This question is similar to above, but not the

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.