Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14348

[Solved] Refreshing Just A Div With Codeigniter

$
0
0
On my script I am able to submit my query form and then it refreshes the div OK

How ever it only seems to refresh once if I click it multiple times will not refresh

Any suggestions on what best way is?




Code:
if (response.success == true) {
   $('.rep').load(window.location.href + ' .rep');
}




Code:
<script type="text/javascript">
$(document).ready(function() {
    $('#vote-up-icon').on('click', function(e) {
        e.preventDefault();
        $.ajax({
            url: "<?php echo base_url('thread/voteup/');?><?php echo $thread_id;?>",
            type: 'post',
            dataType: 'json',
            data: {
                voteup: $(this).parent().find('#vote_up').val()
            },
            success: function(response){
                if (response.success == true) {
                    $('.rep').load(window.location.href + ' .rep');
                }
            }  
        });
    });
});      
</script>

Viewing all articles
Browse latest Browse all 14348

Trending Articles