0

I want to reload a particular div on ajax:success but it is reloading the complete page in that div

$.ajax({
    type: "GET",
    url: "http://192.168.2.210/sciAuthor1/personaldetails/cropImage",
    cache: false,
    success: function (response) {
        parsed = $.parseJSON(response);
        var path = "http://192.168.2.210/sciAuthor1/img/upload/" + parsed;
        $('#up_img').load('http://192.168.2.210/sciAuthor1/user/profile/1'+ '#up_img');
        $edit_dialog.dialog('close');
    }
});


div which i want to reload

<div class="txtc" id="up_img">
   <?php
        $img_path = Commonfunctions::ProfileImage();
        echo $this->tag->image(array('id'=>"profile_image",$img_path,"class"=>"profile_img")) ;
   ?>
</div>


After running this code it reloads the complete page in #up_img.

M Gaidhane
  • 531
  • 8
  • 29

1 Answers1

3
$('#up_img').load(url + '#div_you_want_to_get');
ediblecode
  • 11,701
  • 19
  • 68
  • 116
  • Hi thanks for your reply i have div
    tag->image(array('id'=>"profile_image",$img_path,"class"=>"profile_img")) ; ?>
    and i want to reload image after uploading i tried with $('#up_img').load('http://192.168.2.210/sciAuthor1/user/profile/1'+'#up_img'); but it is loading whole page in #up_img div
    – M Gaidhane Feb 05 '14 at 05:35