我是 Laravel 和 JQuery 的初学者。
我有这个代码:
<ul>
<li class="file-id-46">- <a
href="http://test.test/upload/other/1c186a1229c8c502c9bae2794b52a6f0.pdf"
target="_blank">upload/other/1c186a1229c8c502c9bae2794b52a6f0.pdf</a>
<a href="#" class="red removeThisFile"
id="46">[delete file]</a>
</li>
<li class="file-id-47">- <a
href="http://test.test/upload/other/65b13b47f09fc785d901e43e7864bab2.pdf"
target="_blank">upload/other/65b13b47f09fc785d901e43e7864bab2.pdf</a>
<a href="#" class="red removeThisFile"
id="47">[delete file]</a>
</li>
<li class="file-id-48">- <a
href="http://test.test/upload/other/19846324513791f79013fb8e5a7854d8.pdf"
target="_blank">upload/other/19846324513791f79013fb8e5a7854d8.pdf</a>
<a href="#" class="red removeThisFile"
id="48">[delete file]</a>
</li>
<li class="file-id-49">- <a
href="http://test.test/upload/other/fca69b7c02ae223cd167202368d3a555.pdf"
target="_blank">upload/other/fca69b7c02ae223cd167202368d3a555.pdf</a>
<a href="#" class="red removeThisFile"
id="49">[delete file]</a>
</li>
<li class="file-id-50">- <a
href="http://test.test/upload/other/2a1f88cd9f223a423a29594be3d8ce7a.pdf"
target="_blank">upload/other/2a1f88cd9f223a423a29594be3d8ce7a.pdf</a>
<a href="#" class="red removeThisFile"
id="50">[delete file]</a>
</li>
通常jquery 会正确地向 php (Laravel) 发送查询。问题发生在删除文件。第一个文件被正确删除。下一个文件无法休眠。我怀疑删除前一个文件后我有一个无效的 X-CSRF-TOKEN 令牌。
我该如何解决这个问题?