Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/227.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 返回确认的嵌套报价(';您确定吗?';) 返回“”;_Javascript_Php_Html - Fatal编程技术网

Javascript 返回确认的嵌套报价(';您确定吗?';) 返回“”;

Javascript 返回确认的嵌套报价(';您确定吗?';) 返回“”;,javascript,php,html,Javascript,Php,Html,我对php使用了单引号,对html使用了双引号,但如何在return confirm()中编写?我的意思是我需要写返回确认('you Sure>') 复杂的是,它在php的单引号中,然后在html的双引号中'onclick=“return confirm()”我不能用任何引号来表示确认消息。请建议我只需为PHP单引号转义onclick=“return confirm(\'you sure?\')”就可以了。非常感谢您的重播:)YW。请随意删除这个问题 return '<form acti

我对php使用了单引号,对html使用了双引号,但如何在
return confirm()中编写?我的意思是我需要写
返回确认('you Sure>')

复杂的是,它在php的单引号中,然后在html的双引号中
'onclick=“return confirm()”
我不能用任何引号来表示确认消息。请建议我

只需为PHP单引号转义
onclick=“return confirm(\'you sure?\')”
就可以了。非常感谢您的重播:)YW。请随意删除这个问题
return  '<form action="'.route('own_product_delete', $product_datatable['id']).'" method="post"><input type="hidden" name="_method" value="delete" /><input type="hidden" name="_token" value="'.csrf_token() .'"><button type="submit" onclick="return confirm()" class="btn btn-danger btn-sm mt-1"><i class="fa fa-trash"></i></button></form>';