我需要传递这个id
<img id="id_<?php echo $post_id;?>">
在“这里”
req.open('GET','post.php?slug=??here??',true);
每个 id 都是不同的,因此我需要定位每个帖子的“id”。现在如何传递 id
最佳答案
相当模糊,但你在考虑这样的事情吗?
<a href='post.php?slug=<?=$post_id?>'>
<img id="id_<?php echo $post_id;?>">
</a>
关于javascript - 我如何传递这个 id 变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43944588/