title: how to echo a imagepath and append it after ajax success function in codeigniter?
body: <p>I want to echo my image path using append and also using a variable to store the value but when i do it shows me error let me show you my code.</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
  $(document).ready(function(){
      $(window).scroll(function(){
  
          var lastID = $('.load-more').attr('lastID');
  
          if ($(window).scrollTop() == $(document).height() - $(window).height() &amp;&amp; lastID != 0){
              jQuery.ajax({
                  type:'POST',
  
                  url:'&lt;?php echo base_url("user/get_all_post"); ?&gt;',
                   data: "id=" + lastID,
                      dataType: 'json', 
  
  
                  beforeSend:function(html){
                      $('.load-more').show();
                  },
                  success:function(data){
                         var ParsedObject = JSON.stringify(data);            
                         var json = $.parseJSON(ParsedObject);
  
                          $PostId=json[4]['id'];
  
  
                          for(i=0;i&lt;5;i++ )
                        {
  
                              var post_status = json[i]['status'];
                              var status_image = json[i]['status_image'];
                              var multimage = json[i]['multimage'];
  
                              //           alert($status_image);               
  
  
                               $("#status_data").append('&lt;div style=" margin: 20px 50px 0px 40px; "&gt;&lt;a&gt;&lt;?php echo img($user_image); ?&gt;&lt;/a&gt;&lt;a&gt;&lt;?php echo $uname; ?&gt;&lt;/a&gt;&lt;div&gt;'+post_status+'&lt;/div&gt;&lt;/div&gt;');
  
                               $("#status_data").append('&lt;div style=" margin: 20px 50px 0px 40px; "&gt;&lt;a&gt;&lt;?php echo img($user_image); ?&gt;&lt;/a&gt;&lt;a&gt;&lt;?php echo $uname; ?&gt;&lt;/a&gt;&lt;div&gt;&lt;img src='+&lt;?php base_url('uploads/'.status_image); ?&gt;+'&gt;&lt;/div&gt;&lt;/div&gt;');
  
                              $('#status_image_data').attr('src',status_image);
  
  
                        }
  
  
                         $('.load-more').attr('lastID', $PostId);
  
  
                      }
  
  
              });
          }
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>now here the image is not showing its correct path even if i save the value of status_image in a variable let me show you that too</p>
  
  <p><a href="https://i.stack.imgur.com/FlmNJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FlmNJ.png" alt="image of firebug"></a></p>
  
  <p>now here the path is showing itself in user but the images are stored in uploads how can i access that?</p>