php - Grocery Crud url redirection via javascript -
i trying use custom redirect on grocery crud on save button edit screen. can redirect using url fragment example below:
$the_catalogue_id = $this->uri->segment(count($this->uri->segments)); $this->grocery_crud->set_lang_string('update_success_message', 'your data has been stored database.<br/>please wait while redirecting list page. <script type="text/javascript"> window.location = "'.base_url('catalogues/edit').'/'.$the_catalogue_id.'"; </script> <div style="display:none">' );
i need add window.location.hash end of redirect url, can't seem work. have far:
$this->grocery_crud->set_lang_string('update_success_message', 'your data has been stored database.<br/>please wait while redirecting 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">' );
how add hash variable end of redirect url?
remove double quotes "+thehash"
.
the concatenation operator , variable should not in double quotes in produced javascript.
var thehash = window.location.hash; window.location = "'.base_url('catalogues/edit').'/'.$the_catalogue_id.'#"+thehash;
Comments
Post a Comment