<script>
//some code here
var content = '<div onclick="populatedata(\'' + obj.Records[t] + '\')" >';
function populatedata(obj) {
console.log(typeof obj);
}
</script>
Now output of the above code is string, but I want object content in function populatedata.
obj.Records[t]is an object,contentwill result into<div onclick="[object Object]">.populatedatatoconsole.logthe requested object or a stringified version of it?