对于jQuery Datatables网格,我试图找出如何在删除链接中添加onclick事件(当我需要一个带引号的双引号变量字符串时)。
onlick =“返回确认('你确定吗?')”
$nestedData[] = "<a href=users_delete.php?id=" . $row['id'] . "> Delete </a>";
由于onlick事件需要单引号和双引号来声明它,如何将一个onclick事件添加到存储在变量中的HREF?
谢谢!
答案 0 :(得分:1)
您正在寻找character escaping:
$a = "this is \"quoted\"";
$b = 'this is \'quoted\'';
$c = 'this is "quoted"';
$d = "this is 'quoted'";