Bug Tracker

Opened 8 years ago

Closed 8 years ago

#15248 closed bug (migrated)

Jquery caching DELETE Request on Android

Reported by: knobli Owned by:
Priority: undecided Milestone: None
Component: ajax Version: 1.11.1
Keywords: ajax, phonegap, android, delete Cc:
Blocked by: Blocking:


I'm trying to use ajax() from jquery to send a DELETE Request on Android in a Phonegap App. Like this:

function removeObject(id) {
        type : "DELETE",
        url : getAPIUrl() + '/object.php',
        data : {
            'id' : id
        cache: false
    }).done(function(data) {
        if (data.success) {
        } else {

It looks like the response will be cached, the first request is successful and will be sent to the backend, the second one with another id, is also successful but never get to the backend.

There is no such issue with the same js in Chrome and on iOS.

My workaround is to put a Math.random() variable on the ur:

		type : "DELETE",
		url : getAPIUrl() + '/object.php?' + Math.random() * Math.random(),

Change History (1)

comment:1 Changed 8 years ago by m_gol

Resolution: migrated
Status: newclosed
Note: See TracTickets for help on using tickets.