Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7936569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:15:21+00:00 2026-06-03T22:15:21+00:00

I am encountering a problem with codeigniter and JQuery Ajax Post. My javscript $(‘.remove’).click(function(){

  • 0

I am encountering a problem with codeigniter and JQuery Ajax Post.

My javscript

        $('.remove').click(function(){
        var category=event.target.id;
        var id=$('input[name=article_id]').val();
        var p={};
        p['id']=id;

        $.ajax({
            type: "POST",
            url: "/backend.php/blog/removeCategories",
            async:true,
            cache:false,
            data: {id: id, category: category }
            }).done(function(msg){
                jQuery('#category_list').load('/backend.php/blog/refreshCategories/',p,function(str){});
            });

My codeigniter’s controller

 function removeCategories(){
        $id=$_POST['id'];
        $category_id=$_POST['category'];

        $this->article->removeCategory($category_id,$id);
    }

I can’t get the ajax function to work because there is always an error 500 received from the server. Although, firebug returns that there is an error loading the resources, the function removeCategories was executed anyways.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:15:23+00:00Added an answer on June 3, 2026 at 10:15 pm

    Your error could be in the model. Use chrome dev toolkit to find out what the returned page content is. HTTP CODE 500 means server error, typically due to a syntax problem within PHP somewhere.

    Also,
    In your ajax call you should use success: and error:. This would allow you to halt execution if the code throws an error.

    Why are you calling backend.php/ Are you not using index.php ??

    One other way to do this is instead of using .load() you can simply pass back the html from the controller and then on success: function(data){} append it to the container. This would allow you to monitor whether the ajax call was error() or success() and act accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to JQuery (and JavaScript/AJAX in general) and am encountering a problem with
I am encountering a problem using CFGRID with JQuery. Here are the sample codes
Hello, it's really the first time for me to post. I'am encountering a problem
I am encountering a problem with this addChild function I created (This function is
I'm using Backbone along with jQuery and jqGrid and encountering problem with binding the
I am encountering a problem with string formatting while trying to get only the
I'm encountering a problem trying to generalize my algorithm for any-size problems. The code
I am encountering a problem regarding URL rewriting. I am using Apache's mod rewrite
I recently installed Ubuntu Jaunty and I'm encountering a problem when I try to
Still programming an iPad game in Actionscript 3, I am encountering a problem that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.