0

I have a codeigniter page with url like

 example.com/index.php/test/create

I need to add an ID to the url without reloading my page,I was try

window.location.href=window.location.href+'/'+my_id;

But the page was reloaded.is possible to change my url without reloading my page and add the id as my third segment.After a refresh i need to access that value with

$this->uri->segment(3);
Shijin TR
  • 7,516
  • 10
  • 55
  • 122
  • you can do it by adding `#id` – Tushar Gupta - curioustushar Mar 11 '14 at 11:02
  • i need to access that segment after refrish with $this->uri->segment(3) – Shijin TR Mar 11 '14 at 11:03
  • 3
    duplicate: http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page – Rickert Mar 11 '14 at 11:08
  • I think your question is inherently flawed. CodeIgniter is a php framework, thus it is interpreted on the server. Javascript is a client-side language, so even if you can accomplish changing the URL without refreshing. CodeIgniter will not be made aware of the 'id' until the page is submitted or refreshed. – Ryan H Dec 15 '14 at 22:05

0 Answers0