Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当他单击 div 时,我试图将用户重定向到页面。我想知道如何将用户从 html 视图重定向到 CI 的新控制器?
谢谢你
在您的 html 视图中添加以下代码,
$(function(){ $('#div_id').on('click',function(){ window.location.href = "<?php echo site_url('new_controller'); ?>"; }); });
请更改div_idandnew_controller以满足您的需要。
div_id
new_controller