Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/440.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
PHP在echo时转换javascript_Php_Javascript - Fatal编程技术网

PHP在echo时转换javascript

PHP在echo时转换javascript,php,javascript,Php,Javascript,我有以下PHP echo语句: echo”“; 将其转换为html,如下所示: 正如你所看到的,出了什么问题? 有什么问题?我已经尝试过为单个'交换,,您忘记了href之后的'。像这样使用它 双引号: echo "<td><a href='delete-news.php?deleteID=".$id."' onclick=\"return confirm('Really delete?');\">Delete</a></td>"; echo

我有以下PHP echo语句:

echo”“;

将其转换为html,如下所示:

正如你所看到的,出了什么问题?
有什么问题?我已经尝试过为单个
'
交换

您忘记了href之后的
'
。像这样使用它

双引号:

echo "<td><a href='delete-news.php?deleteID=".$id."' onclick=\"return confirm('Really delete?');\">Delete</a></td>";
echo '<td><a href="delete-news.php?deleteID='.$id.'" onclick="return confirm(\'Really delete?\');">Delete</a></td>';
echo”“;
单引号:

echo "<td><a href='delete-news.php?deleteID=".$id."' onclick=\"return confirm('Really delete?');\">Delete</a></td>";
echo '<td><a href="delete-news.php?deleteID='.$id.'" onclick="return confirm(\'Really delete?\');">Delete</a></td>';
echo';

您忘记了href之后的
。像这样使用它

双引号:

echo "<td><a href='delete-news.php?deleteID=".$id."' onclick=\"return confirm('Really delete?');\">Delete</a></td>";
echo '<td><a href="delete-news.php?deleteID='.$id.'" onclick="return confirm(\'Really delete?\');">Delete</a></td>';
echo”“;
单引号:

echo "<td><a href='delete-news.php?deleteID=".$id."' onclick=\"return confirm('Really delete?');\">Delete</a></td>";
echo '<td><a href="delete-news.php?deleteID='.$id.'" onclick="return confirm(\'Really delete?\');">Delete</a></td>';
echo';

您的
onclick
语句中有双单引号,请尝试
确认(\'Really delete?\')

您的
onclick
语句中有双单引号,请尝试
确认(\'Really delete?\')

您的
href
语句未关闭。此外,您的
真的删除了
也会带来麻烦。试试这个

echo "<td><a href='delete-news.php?deleteID=$id' onclick='return confirm(\"Really delete?\");'>Delete</a></td>";
echo”“;

您的
href
未关闭。此外,您的
真的删除了
也会带来麻烦。试试这个

echo "<td><a href='delete-news.php?deleteID=$id' onclick='return confirm(\"Really delete?\");'>Delete</a></td>";
echo”“;

您的示例有相同的错误:单击时没有警告问题,这是目标。为什么要额外标记?在echo上使用单个``不是比在echo中使用普通html更简单吗?很抱歉给您添麻烦,但为什么这不正确:
“”你正在用“in confirm()no”关闭onclick。这两种情况都是这样。看,这一个“在
中断之前”
正在中断
onclick
<代码>
您的示例有相同的错误:单击时没有警告问题,这是目标。为什么要额外标记?在echo上使用单个``不是比在echo中使用普通html更简单吗?很抱歉给您添麻烦,但为什么这不正确:
“”你正在用“in confirm()no”关闭onclick。这两种情况都是这样。看,这一个“在
中断之前”
正在中断
onclick
<代码>