js中onclick事件中传入object对象参数,将object对象转成字符串

var data = {"report_file_name":"128_20180601152433_Report_gl5lmm.pdf",
"downCount":27,
"userCount":45,
"role_id":1,
"report_id":1
};
var dom = '
  • +'"readPdf(' + JSON.stringify(data).replace(/"/g, '"')+')">';

    你可能感兴趣的:(js中onclick事件中传入object对象参数,将object对象转成字符串)