0

私は単純なhtmlボタンを使用してデータを送信しています.私はcodeigniterフレームワークを使用しています.次のコードは、ページをキャンセルして前のページに戻るための私のボタンです.

<input type="button" value="Cancel" onclick="" class="cancel_button">

キャンセルボタンをクリックすると、次のURLに移動するはずです

http://localhost/sample/categorycontroller/index

ボタンからURLを渡す方法を教えてください。

前もって感謝します

4

3 に答える 3

2

これを試して:

<input type="button" value="Cancel" onclick="window.location = 'http://localhost/sample/categorycontroller/index'" class="cancel_button">
于 2013-06-03T08:49:42.580 に答える
0
<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>
于 2013-06-03T08:51:58.977 に答える
0

これを使用してください:

 <input type="button" value="Cancel" onclick="window.location.href = 'http://localhost/sample/categorycontroller/index'" class="cancel_button">
于 2013-06-03T08:50:22.877 に答える