页面报xxxxx未定义错误时:

1、首先先定义它:

 

var xx=xxxxx;

2、如果不行:

试着加 ' 号试试如:

var str='<div onclick="sqtd('+row.order_id+','+row.st+',\' '+row.dis_order_code+' \')";><a href="javascript:"void(0)";"><i class="glyphicon glyphicon-trash" aria-hidden="true"></i></a></div>';

这是循环加入的其中row.dis_order_code是个“PT2016092180000079”类似的值用的时候页面老是报未定义的错误无法打开页面结果加入  \'  后就问题就解决了当然加入 ‘

一定要用 \ 来转义

 

相关文章:

  • 2021-12-27
  • 2022-12-23
  • 2023-01-10
  • 2021-10-30
  • 2022-12-23
  • 2021-11-26
  • 2021-06-23
猜你喜欢
  • 2021-06-22
  • 2022-02-12
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案