Sinan Samet
Sinan Samet

Reputation: 6752

ajax data doesn't change

I editted my ajax data but it still shows the old version while I am sure I saved it I even reopened the file and checked the location. It's like it is cached.

This is the actual code:

function setMessages(roomId, username, message){
    $.ajax({
        type: "get",
        url: "http://www.sinansamet.nl/chatdistract/ajax/setMessages.php",
        data: { roomId:roomId, username:username, message:message },
        success: function(html) {
                  strReturn = html;
                }
        });
}

But what it sees is

function setMessages(id){
    $.ajax({
        type: "get",
        url: "http://www.sinansamet.nl/chatdistract/ajax/setMessages.php",
        data: { id:id },
        success: function(html) {
                  strReturn = html;
                }
        });
}

Which was the old code.

The error is given in the console as "undefined id"

Upvotes: 0

Views: 140

Answers (2)

user1889970
user1889970

Reputation: 736

Do a browser refresh cache on most browsers it can be done by pressing CTRL + F5 Search google for clearing your browser cache.

Upvotes: 2

John Boker
John Boker

Reputation: 83709

the a in ajax stands for asynchronous.

the function is returning before the callback of the ajax call is being called.

Upvotes: 1

Related Questions