0
我想在編輯屏幕上的保存按鈕上使用雜貨crud上的自定義重定向。我可以成功地使用重定向的URL片段如下面的例子:通過javascript雜貨Crud url重定向
$the_catalogue_id = $this->uri->segment(count($this->uri->segments));
$this->grocery_crud->set_lang_string('update_success_message',
'Your data has been successfully stored into the database.<br/>Please wait while you are redirecting to the list page.
<script type="text/javascript">
window.location = "'.base_url('catalogues/edit').'/'.$the_catalogue_id.'";
</script>
<div style="display:none">'
);
我現在需要的window.location.hash添加到重定向URL的結束,但似乎無法得到它的工作。這是我到目前爲止:
$this->grocery_crud->set_lang_string('update_success_message',
'Your data has been successfully stored into the database.<br/>Please wait while you are redirecting to the list page.
<script type="text/javascript">
var thehash = window.location.hash
window.location = "'.base_url('catalogues/edit').'/'.$the_catalogue_id.'"#"+thehash";
</script>
<div style="display:none">'
);
如何將哈希變量添加到重定向URL的末尾?