0
if($(xml).find("error") == 'Search short, please enter a longer search item')
{
  showMinChar();
}

And in my XML

<SearchResults>
<error>Search short, please enter a longer search item</error>
</SearchResults>

Is being displayed but the function showMinChar(); is not being called why?

3
  • 1
    Without seeing your showMinChar() function, no-one can help you debug it. Also, are you seeing / getting any errors in your JS console? Commented Feb 29, 2012 at 9:32
  • No Errors - all showMinChar() does is display a error message onto the screen- i know this works because i've tested it Commented Feb 29, 2012 at 9:36
  • 2
    you missed $(xml).find("error").text() in your if statement Commented Feb 29, 2012 at 9:38

1 Answer 1

2

Use like this

if($(xml).find("error").text() == 'Search short, please enter a longer search item')
{
  showMinChar();
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.