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 676047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:53:06+00:00 2026-05-14T00:53:06+00:00

I have a page where the user can edit various content using buttons and

  • 0

I have a page where the user can edit various content using buttons and selects that trigger ajax calls. In particular, one action causes a url to be called remotely, with some data and a ‘put’ request, which (as i’m using a restful rails backend) triggers my update action. I also have a delete button which calls the same url but with a ‘delete’ request. The ‘update’ ajax call works in all browsers but the ‘delete’ one doesn’t work in IE. I’ve got a vague memory of encountering something like this before…can anyone shed any light? here’s my ajax calls:

//update action - works in all browsers
jQuery.ajax({
  async:true, 
  data:data, 
  dataType:'script', 
  type:'put', 
  url:"/quizzes/"+quizId+"/quiz_questions/"+quizQuestionId,
  success: function(msg){ 
    initializeQuizQuestions();
    setPublishButtonStatus();
  }
});  



//delete action - fails in ie
  function deleteQuizQuestion(quizQuestionId, quizId){
    //send ajax call to back end to change the difficulty of the quiz question
    //back end will then refresh the relevant parts of the page (progress bars, flashes, quiz status)
    jQuery.ajax({
      async:true, 
      dataType:'script', 
      type:'delete', 
      url:"/quizzes/"+quizId+"/quiz_questions/"+quizQuestionId,
      success: function(msg){ 
        alert("success");
        initializeQuizQuestions();
        setSelectStatus(quizQuestionId, true);
        jQuery("tr[id*='quiz_question_"+quizQuestionId+"']").removeClass('selected');        
      },
      error: function(msg){
        alert("error:" + msg);
      }
    });     
  }

I put the alerts in success and error in the delete ajax just to see what happens, and the ‘error’ part of the ajax call is triggered, but WITH NO CALL BEING MADE TO THE BACK END (i know this by watching my back end server logs). So, it fails before it even makes the call. I can’t work out why – the ‘msg’ i get back from the error block is blank.

Any ideas anyone? Is this a known problem? I’ve tested it in ie6 and ie8 and it doesn’t work in either.

thanks – max

EDIT – the solution – thanks to Nick Craver for pointing me in the right direction.

Rails (and maybe other frameworks?) has a subterfuge for the unsupported put and delete requests: a post request with the parameter “_method” (note the underscore) set to ‘put’ or ‘delete’ will be treated as if the actual request type was that string. So, in my case, i made this change – note the ‘data’ option’:

   jQuery.ajax({
      async:true, 
      data: {"_method":"delete"},
      dataType:'script', 
      type:'post', 
      url:"/quizzes/"+quizId+"/quiz_questions/"+quizQuestionId,
      success: function(msg){ 
        alert("success");
        initializeQuizQuestions();
        setSelectStatus(quizQuestionId, true);
        jQuery("tr[id*='quiz_question_"+quizQuestionId+"']").removeClass('selected');        
      },
      error: function(msg){
        alert("error:" + msg);
      }
    });     
  }

Rails will now treat this as if it were a delete request, preserving the REST system. The reason my PUT example worked was just because in this particular case IE was happy to send a PUT request, but it officially does not support them so it’s best to do this for PUT requests as well as DELETE requests.

  • 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-05-14T00:53:07+00:00Added an answer on May 14, 2026 at 12:53 am

    Take a look at your type attribute type:'delete'

    jQuery documentation on type:

    The type of request to make (“POST” or “GET”), default is “GET”. Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.

    I would instead try and include this with your data and look for it on the server-side, like this:

    data: {'action': 'delete'},
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form on a page that a user can use to create
I have a list of items on my web page that the user can
I have a page which displays a form that a logged-in user can use
I have a page on my MVC application where a user can edit /
I have a page that has a form on it where the user can
I have a page, where user can edit his own info. On this page
I have a Details and Edit page from where the user can send out
I have a RichTextBox that the user can edit to create a hyperlink (in
I have a page where a user can import data to the site. either
I have a page where the user can dynamically add file upload boxes. Adding

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.