user3631967 user3631967 - 1 year ago 125
Javascript Question

How to access property of js object

here is the response code

echo json_encode( array('success' => $stat,'msg'=>$file));

return from the server response

Object {success: "success", msg: "2017_nissan_gtr-2560x14409.jpg"}

Answer Source
var response = {success: "success", msg: "2017_nissan_gtr-2560x14409.jpg"}
var success = response.success;
var msg = response.msg;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download