Is there any way to execute a specific JavaScript segment based on the length of an AJAX response?
This is what I have attempted so far:
$.ajax({
type: "POST",
url: action,
data: form_data,
success: function(response) {
if(length == 7)
//execute this
else
//execute that
Even though the response received by the script is exactly 7 characters long, it still defaults to the 'else' script. What could be causing this issue?