0

Hi guys,
I am getting very weird issue here. On my wampserver, this script works fine but not on my liver server which is linux. This is what it does. After a checkbox gets checked, the scripts identifies that and insert a row in table and that script send back a notification saying "new row entered". On my local wamp, it works fine but on the live server, it is able track my checkbox checking, it inserts the record too but, the checkbox doesn't it is being checked. below is the jQuery for it.

<script type="text/javascript">
/* adding category on each click*/
    $('#post_cat_id2').click(function() {
        if($(this).prop('checked') == true)
        {
            var form_data   =   {
                post_cat_id: $('#post_cat_id2').val(),
                action: 'add'
            };
            $.ajax({
                url: "http://localhost/MIS_ServerCopy/index.php/posts/ajax_set_categorytopost",
                type: 'POST',
                data: form_data,
                success: function(msg){
                    $('#Postsnotifications').hide().html(msg).fadeIn('slow'); //appending newly added categories, in
                    $('#post_cat_id2').prop('checked', 'checked');
                }
            });
        }
        else
        {
            var form_data   =   {
                post_cat_id: $('#post_cat_id2').val(),
                action: 'add'
            };

            $.ajax({
                url: "http://localhost/MIS_ServerCopy/index.php/posts/ajax_set_categorytopost",
                type: 'POST',
                data: form_data,
                success: function(msg){
                    $('#Postsnotifications').hide().html(msg).fadeIn('slow'); //appending newly added categories, in
                    $('#post_cat_id2').prop('checked', false);
                }
            }); 
        }
    return false;
});
</script>
2
Contributors
1
Reply
19
Views
4 Years
Discussion Span
Last Post by LastMitch
0

This is what it does. After a checkbox gets checked, the scripts identifies that and insert a row in table and that script send back a notification saying "new row entered". On my local wamp, it works fine but on the live server, it is able track my checkbox checking, it inserts the record too but, the checkbox doesn't it is being checked. below is the jQuery for it.

There's nothing wrong with your Ajax code.

You need to add cache in your Ajax code.

I think you need to double check your words in your code that you have and compare with the words in your code on the html side also any entities (missed a period or comma and etc).

That's the only thing I can think of because you only provided Ajax code.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.