Welcome Guest, Not a member yet? Register   Sign In
enabling history (ajax/ci)
#1

[eluser]spherop[/eluser]
i am writing an ajax heavy app and am just starting my investigation of how to enable history.

i am also somewhat new to ci.

one thing i am looking into is changing the url via javascript of the browser by appending something like '#c=application&m=display_post&postid=25'.

this will not refresh the browser.

what i'd like is if the user bookmarked this url, and revisited it later, or hit the back button in the browser to revisit, CI would be able to convert it to simply remove the hash (#) and treat the url as 'index.php?c=application&m=display_post&postid=25'.

so if the user ajax-loads content or changes the page state, as long as i support viewing that state from a normal non-hash url, i can convert the hash based url and my ci code will respond as it should.

i have had to 'enable_query_strings' in my ci config - this is a facebook app and i have to Sad.

i may be attempting this in a roundabout or simply lame way ... feel free to suggest alternatives.

i have looked at really simply history ... but it does not seem to work in all browsers. also, in my case i intend to support every view from a valid url - so i am wondering/hoping i can approach this from a very simple angle using the # and changing the browser url in js functions which ajax load content.

i hope this makes some sense and welcome comments.




Theme © iAndrew 2016 - Forum software by © MyBB