Skip to main content

Base on your code, the value you get is a string not an objectstring not an object. 

so the code : var relateditmid = relateditm[0].ItemId;var relateditmid = relateditm[0].ItemId; will return the item ID after converting the string relateditmrelateditm to Object using eval funtion.

var relateditmObj = eval(relateditm); var relateditmid = relateditmObj[0].ItemId;

var relateditmObj = eval(relateditm);
var relateditmid = relateditmObj[0].ItemId;

Base on your code, the value you get is a string not an object. so the code : var relateditmid = relateditm[0].ItemId; will return the item ID after converting the string relateditm to Object using eval funtion.

var relateditmObj = eval(relateditm); var relateditmid = relateditmObj[0].ItemId;

Base on your code, the value you get is a string not an object. 

so the code : var relateditmid = relateditm[0].ItemId; will return the item ID after converting the string relateditm to Object using eval funtion.

var relateditmObj = eval(relateditm);
var relateditmid = relateditmObj[0].ItemId;
Source Link
must19
  • 758
  • 5
  • 11

Base on your code, the value you get is a string not an object. so the code : var relateditmid = relateditm[0].ItemId; will return the item ID after converting the string relateditm to Object using eval funtion.

var relateditmObj = eval(relateditm); var relateditmid = relateditmObj[0].ItemId;