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
Post a Comment