Thanks for all the replies.

Fabio: Yeah I had some code with the hash thing but I didnt understand
how it worked exactly so it ended up going to that address., now that
I know ill check how can I use it properly.

Sandy: Thats also true. I have taken that into account already, when I
call the content from ajax I also send an extra parameter
( remote=true ) so that the controller knows if he has to render the
view with or without the full template or just the needed content.

rpflo: Yes I meant hitting the refresh button or pressing F5.

So far It looks like this, correct me if im wrong:

The address in the bar will ALWAYS be www.server.com/home but it can
change to www.server.com/home#store, www.server.com/home#contact
etc... as I navigate with the menu.

So what I have to do is to rather use a combination of htaccess and
server side logic to load the content, or have javascript handle the
logic of processing the hash and load the proper content.

That way If the user types for example www.server.com/store I can
render the correct view, and the user will also have the ability to
navigate from there as in any other URL setting hash to something like
www.server.com/store#home  or www.server.com/store#contact.

Is that correct?


Than ks everyone for their help =]

Alex,






On May 22, 6:45 am, Fábio Costa <[email protected]> wrote:
> if the new hash is '' then you should set it to '#'.
>
> Wont reload and works fine.
>
> Fábio Miranda Costa
> Engenheiro de Computaçãohttp://meiocodigo.com
>
> On Fri, May 22, 2009 at 4:58 AM, Thierry bela nanga <[email protected]>wrote:
>
> > it looks like setting hash to an empty string cause the page to reload in
> > FF, I have not tested it in other browsers
>
> > On Thu, May 21, 2009 at 9:30 PM, rpflo <[email protected]> wrote:
>
> >> I'm having a little trouble understanding ...
>
> >> "the content changes but the page doesnt reloads so the adrees in the
> >> bar remainswww.server.com/home.
>
> >> I want that when the user reloads the page it goes to
> >>www.server.com/contact
> >> and notwww.server.com/home."
>
> >> When you say "reloads" in the second paragraph do you mean the ajax
> >> request or they actually hit refresh/reload?
>
> >> If you mean the ajax request (and not an actual reload), you can't
> >> change the text in the address bar with javascript.  So as the user
> >> clicks the address bar will always readwww.server.com/home.
>
> >> If you want that to change as they click you could use
> >>www.server.com/#contact
> >> (as mentioned by Sandy).
>
> >> If you want the user to be able to type inwww.server.com/contactyou
> >> could use a combination htaccess and php to load the proper content.
>
> >> On May 21, 2:10 pm, Sanford Whiteman <[email protected]>
> >> wrote:
> >> > > I want that when the user reloads the page it goes
> >> towww.server.com/contact
> >> > > and notwww.server.com/home.
>
> >> > You  cannot  change  the  hostname  or  path  that "would be" reloaded
> >> > without  actually  reloading  the document. In other words, you cannot
> >> > rewrite  the  main  content  of  the  location bar/textbox without the
> >> > browser also going to that location.
>
> >> > The  exception  is  the # hash. Changing the hash will not reload from
> >> > scratch.  But  your URLs are not currently constructed to use the hash
> >> > to  determine the inner content. If you change this structure, it will
> >> > work.
>
> >> > --Sandy
>
> > --
> > fax : (+33) 08 26 51 94 51

Reply via email to