title: .Css() function returning undefined
body: <p>currently i am facing one problem in my code snippet where i am retrieving image url from css file based on image code where image code comes from another website
      and again another function takes image code as an argument make it as css class. </p>
  
  <p>Based on the css class using .css() in jquery to retrieve the image url but when page initially loads it is returning "undefined" after some seconds it is returning correct image urls:</p>
  
  <p><strong>JS function making image code as css class:</strong></p>
  
  <pre><code>$scope.placeholderNetworkImage = function(networkBenefitIcon){
      var selectorClassName = "."+ networkBenefitIcon;
      var blnResult = false;
  
       if(networkBenefitIcon!=="null" &amp;&amp; networkBenefitIcon!=="")
       {
  
          var imagePresent = $(selectorClassName).css('backgroundImage');
          console.log("image of url is: "+imagePresent);
          if (imagePresent == 'none' || imagePresent == null) {
             blnResult = true;
          }
          else 
          {
              blnResult = false;
          }
       }
      else
      {
         blnResult = true;
      }
         return blnResult;
  }
  </code></pre>
  
  <p><strong>HTML Code</strong></p>
  
  <pre><code>&lt;div class="media-left"&gt;
    &lt;ul&gt;
      &lt;li class="networkBenefitIconLi" ng-repeat="networkBenefitIcon in 
             item.t_css_tariffBenefit.split('|') track by $index | limitTo:3"&gt;
        &lt;span ng-class="networkBenefitIcon" class="networkBenefitIcon" ng-
                     show="!placeholderNetworkImage(networkBenefitIcon)"&gt;
            &lt;/span&gt;
        &lt;span class="networkBenefitIcon tickLightGray" ng-
                      show="placeholderNetworkImage(networkBenefitIcon)"&gt;
            &lt;/span&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p>output:</p>
  
  <p><a href="https://i.stack.imgur.com/E9gil.png" rel="nofollow noreferrer">it was output shown on console here you can find some were image url's and some are showing "undefined"</a></p>
  
  <p>Kindly help me with this problem as it was a huge performance issue form our side.please any one tell me why it was returning "undefined" even though image was present in the css.</p>