Laxman Rana
Laxman Rana

Reputation: 2924

Append value to response text returned by ajax

I want to append value to response text that i am getting back from ajax request.

I used below code

$(document).ajaxSuccess(function(event, response, settings) {
  var resp = response.responseText;       
});

Suppose i am getting response text

i.e

/home/xyz

and i want append

/home/xyz/abc

Any help appreciated

Upvotes: 0

Views: 555

Answers (1)

karthikr
karthikr

Reputation: 99620

If i understand your question right, you can always do

$(document).ajaxSuccess(function(event, response, settings) {
  var resp = response.responseText;
  var new_resp = resp + '/abc';
  window.location.href = new_resp;

});

Upvotes: 1

Related Questions