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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -