jQuery If statement - variable from a php post - then do this -


I am trying to compare a variable that contains text from the php file. Data1 will only be either "active" or "idle", as is back by php. I have tried so many variations of things, I also try to get the value of #activity to see if it is equal to "active".

  var url = "A_jq.php"; $ .post (url, {state2: str}, function (data1) {$ ("# activity") .html (data1) .online (); console.log (data1); if (data1 == " Active ") {$ (" add # "). Show (" slow ");}});  

trim data1

code>

  data1.trim ()    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -