我将一个值id传递给javascript函数。这里的id正在打印。如何将id从javascript传递到codeigniter中的引导模型?
<script>
function openModal(id) {
document.getElementById('myModal').style.display = "block";
var img_id = id;
document.getElementById('caption').innerHTML = img_id;
}
</script>
现在我想将这个值传递给引导模式
<div id="myModal" class="modal">
<button type="button" id="close" onclick="closeModal()">close</button>
<div class="modal-content">
<div class="mySlides">
<?php
//here i want to use this id with if condition so that desired image is
//displayed.With for each all images are coming.
//$project_images = explode(",", $value['project_gallery']);
$project_images = json_decode($value['project_gallery'],true);
foreach ($project_images as $project_image_value) {
?>
<img src="<?= base_url() ?>assets/uploads/projects/<? =$project_image_value['fname']?>" style="width:100%">
<?php
}
?>
</div>
</div>
</div>
是有可能。如果真让我知道。
你能更具体吗? – user218046
我想将img_id从javascript函数传递到引导模型,以便我将在模型中使用 –
您要在哪里确定该id在模型中? – user218046