JavaScript Undefined variable $.parseJSON

My authenticate.php file is returning an object

Json: [{"u_id":"1","u_name":"Nabeel" }]

Here is my js:

success: function(result) {
  var obj=$.parseJSON(result);
  alert(result);      //[{"u_id":"1","u_name":"Nabeel" }]
  alert(obj.u_id);    //undefined
  window.location="#timeline";
}

I want to save u_id and name in a separate variables but I keep on getting undefined as a result.

I tried using the jQuery.parseJSON function as well but I was getting "undefined variable Jquery"

Answer:1

I'm writing a program that calculates the price of painting rooms in a house. The program asks the user a couple of questions and the user must input certain answers regarding the topic. The program ...

I'm writing a program that calculates the price of painting rooms in a house. The program asks the user a couple of questions and the user must input certain answers regarding the topic. The program ...

  1. javascript repeat validation

as stated in the name, i have a menu with links, and i have a list of sections which i want to show/hide on the click of the menu. What i want here is to be dynamic in a sense that if i add more menus ...

as stated in the name, i have a menu with links, and i have a list of sections which i want to show/hide on the click of the menu. What i want here is to be dynamic in a sense that if i add more menus ...

  1. show content only on mobile
  2. show content only on homepage wordpress
  3. show content only from this computer
  4. wordpress show content only to logged in users
  5. tar show content only
  6. curl show content only
  7. wordpress show content only if logged in
  8. php show content only if logged in
  9. chrome show content only
  10. show my cloud-only content from onedrive
  11. show hide content css only
  12. sharepoint show page content only
  13. how to show only content in excel
  14. ie show secure content only
  15. show content only

I'm using the 500px API module with Node.js and I'm trying to get photos of a specific user. I'm facing issue with function, callback and scope... I've this code : api500px.photos.getByUsername ('...

I'm using the 500px API module with Node.js and I'm trying to get photos of a specific user. I'm facing issue with function, callback and scope... I've this code : api500px.photos.getByUsername ('...

  1. return data callback function
  2. return data callback
  3. return data callback javascript
  4. return data from callback node js
  5. return data from callback function javascript
  6. return data from callback js
  7. return data ajax callback
  8. nodejs return data callback
  9. node return data from callback
  10. python return data from callback
  11. matlab return data from callback

I have a php file on my server to upload file. I tried to upload using that file directly and it was success. Then I wrote a simple phantomjs script, run it on ubuntu with phantomjs version 2.1.1 but ...

I have a php file on my server to upload file. I tried to upload using that file directly and it was success. Then I wrote a simple phantomjs script, run it on ubuntu with phantomjs version 2.1.1 but ...

  1. canvas
  2. canada
  3. cancelled
  4. canceled vs cancelled
  5. cancun
  6. canada goose
  7. cane corso
  8. canes
  9. canadian prime minister
  10. cancun flights
  11. canker sore
  12. candy
  13. cancer
  14. canon
  15. canvas prints
  16. cancer sign
  17. candace owens
  18. canada news
  19. candytopia
  20. canlis