brihol44
asked on
$.Ajax success data.value parse
Hello,
I'm trying to return the value in the success (data) part of my $ajax call. I've looked through Google but what I'm looking for is a coded solution below. I don't think it's that complex from similar examples I've seen. I just can't seem to get mine working.
When I add alert(data); I get...
<wddxPacket version='1.0'><header/><da ta><string >1</string ></data></ wddxPacket >
but I would like to be able to run 2 different functions if <string> eq "1" or "". Is that possible?
I'm trying to return the value in the success (data) part of my $ajax call. I've looked through Google but what I'm looking for is a coded solution below. I don't think it's that complex from similar examples I've seen. I just can't seem to get mine working.
When I add alert(data); I get...
<wddxPacket version='1.0'><header/><da
but I would like to be able to run 2 different functions if <string> eq "1" or "". Is that possible?
$.ajax({
type: "POST",
url: "app/func_main.cfc?method=login",
data: data,
cache: false,
success: function (data) {
alert(data);
if (data.string == 1) {
function1();
} else {
function2();
}
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER