0

Allright, this is what I have in a variable.

[SXWE] Nickname : test
{
  "Message": "test",
  "UserId": 50,
  "Username": "Nickname"
}

I want to check if this json object exists by using hasOwnproperty. The issue here is that I have something before the object itself and it seems like it does not find the key of the Object because it is getting blocked at the first line

Nox
  • 17
  • 5
  • 1
    If your json always starts from the second lien, just skip the first line. – Wonjung Kim Apr 21 '17 at 13:51
  • Yeah, it never gets into the same line. I assume it is always starting from a new line. But the first line might not always be only one line. It could be a total of two lines at the beginning – Nox Apr 21 '17 at 13:58
  • Perhaps , you should extract JSON from you text then parse it , you will find an answer in this http://stackoverflow.com/a/10574546/5244459 – Ezzat Apr 21 '17 at 16:48

0 Answers0