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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:46:13+00:00 2026-05-27T20:46:13+00:00

I used Ajax POST to update a JSON object but when I tried to

  • 0

I used Ajax POST to update a JSON object but when I tried to retrieve the JSON object simultaneously after that, it returned the old data of the JSON object.

How do I delete this old object and always retrieve the new one? This how the GET looks like:

http://localhost:8080/direct/forum_message/getListOfMessagesForSite/e81957d5-48db-49f3-a479-4077f13d1d6e.json?sakai.session=64d12629-ba76-4754-a353-7974b55e3356

In addition I want to have the ability to :

  • send a message and update a msg list jSON object.
  • Immediately call GET to retrieve the object with a new updated data.(the one with new added message).

here is POST method code :

this.sendMessage = function(params)
 {
    var url = baseURL+"/direct/forum_message/sendMessage";
    if(!params){
        params = {'sakai.session': sessionId, 'siteId': siteId, 'toolId':toolId};
    }
    else
    {
        params.sessionId = sessionId;
        params.siteId = siteId;
        params.toolId = toolId;
    }
    var ret = false;    
    var ajaxOptions = {
        url: url,
        data: params,
        type: "POST",
        traditional: true,
        async: false,
        complete: function(data){
            if(data.status == 0 || data.status == 200 || data.status == 201)
            {
                ret = $.parseJSON(data.responseText);
            }
        }
    };
    $.ajax(ajaxOptions);
    return ret;
 }

and GET method:

  this.getListOfMessagesForSite = function()
 {
    var url = baseURL+"/direct/forum_message/getListOfMessagesForSite/"+siteId+".json";             
    var params = (sessionId != "") ? {'sakai.session': sessionId} : null;
    var ret = null;
    var ajaxOptions = {
        url: url,
        data: params,
        type: "GET",
        dataType: "json",
        async: false,
        complete: function(data){
            if(data.status == 0 || data.status == 200 || data.status == 201)
            {
                ret = $.parseJSON(data.responseText);
            }
        }
    };
    $.ajax(ajaxOptions);
    return ret;
 }
  • 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-27T20:46:14+00:00Added an answer on May 27, 2026 at 8:46 pm

    My shot in the dark is the cache option:

    cache Boolean
    Default: true, false for dataType ‘script’ and ‘jsonp’

    If set to false, it will force requested pages not to be cached by the
    browser. Setting cache to false also appends a query string parameter,
    "_=[TIMESTAMP]", to the URL.

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

Sidebar

Related Questions

I've always used ajax to load() the contents of a DOM element but now
I used to have a simple ajax that helped me take all items from
Several of my ajax applications in the past have used GET request but now
I have a jquery dialog box that is used to edit and update a
I'm trying to use AJAX and JSON inside CodeIgniter. I've never used either technologies
Update My problem was that I used event.preventDefault() instead of return false to hinder
I am trying to use .ajax() to post a People object to a MVC2
I have always used the Scriptmanager to handle all AJAX calls, but I am
I've never used AJAX and am, quite frankly, not much versed in JS either.
Thus for used ajax enabled wcf services to get records from DB and display

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.