I have a page for live scores results for each match the page have two sections the up section which have the live result and match information and the down section which has comments area. when i make a comment and click submit the page refresh and go up to the information section i want to add the comment and refresh the page and then go down to the place of the comment (not going up). my code of the comment box is:
$("#section_bar").after('<textarea rows="4" cols="50" id="" class="comment_area" name="reply_area" ></textarea><a class="comment button small black" href="#" id="reply_'+match_id+'"><span>submit</span></a>');
$("#reply_"+match_id).live('click',function(){
text_area_value = $('textarea').val();
$.ajax({
type: "POST",
url: 'comment_proxy.php',
data:{id:match_id, user_id:user_id, reply:text_area_value, date:today1, time:time},
dataType: "json",
success: function(data)
{
location.reload();
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
/*alert(XMLHttpRequest);
alert(textStatus);
alert(errorThrown);
alert(XMLHttpRequest.responseText);*/
}
});
});
My question is : IS there any line of code that I can add it after location.reload()
to force the page to submit and refresh and then stay at the same point or return to the same point that we was in before the submitting ????