我正在使用一个简单的HTML按钮来提交数据。我正在使用codeigniter框架。以下代码是我的按钮,用于收起页面并返回上一页。通过按钮传递网址
<input type="button" value="Cancel" onclick="" class="cancel_button">
当我点击取消按钮就应该到以下网址
http://localhost/sample/categorycontroller/index
请让我知道,如何通过按钮传递的URL。?
在此先感谢
我正在使用一个简单的HTML按钮来提交数据。我正在使用codeigniter框架。以下代码是我的按钮,用于收起页面并返回上一页。通过按钮传递网址
<input type="button" value="Cancel" onclick="" class="cancel_button">
当我点击取消按钮就应该到以下网址
http://localhost/sample/categorycontroller/index
请让我知道,如何通过按钮传递的URL。?
在此先感谢
请用户这样的:
<input type="button" value="Cancel" onclick="window.location.href = 'http://localhost/sample/categorycontroller/index'" class="cancel_button">
试试这个:
<input type="button" value="Cancel" onclick="window.location = 'http://localhost/sample/categorycontroller/index'" class="cancel_button">
谢谢@利多..它完美的工作..感谢您看我的问题和答案..谢谢很多 – bhai
<input type="button" value="Cancel" onclick="goBack()" class="cancel_button">
然后创建一个名为Javascript函数goBack()
<script type="text/javascript">
function goBack() {
window.location = 'http://localhost/sample/categorycontroller/index';
}
</script>
onclick =“history.go(-1);” ???只是去上一页? – swapnesh