I Know It's Possible (AJAX)

  • Azoundria
  • Professor
  • Professor
  • User avatar
  • Posts: 907
  • Loc: Calgary, Alberta, Canada

Post 3+ Months Ago

Hi everyone,

I've seen on a site that managed to use AJAX to load the page content without the background on every link, but also allowed the back and forward buttons to work. Unfortunately, I've lost the link and can't remember who gave it to me, but I did take a look at it.

They had an anchor for each page, for example index.php#page6 would load page6. Then, links could be set to go to #page6, and the whole page would not reload, but if someone copied the link, it would load the entire page for them.

What I'm having trouble with is, nothing past # goes to the server-side, so how can the server display that page instead of the default one? My guess is a client-side script of some kind, perhaps JavaScript. Can anyone help me with this?
Moderator Remark: Question restored in case others come here with the same issue.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

The easiest way is to let something like the Really Simple History (RSH) lib handle it for you. There's a few different solutions out there, but most center around hidden iframes and anchors or server-side vars that you use in building the history. You can find a decent explanation of what I mean here.

You can Google something like "Ajax Forward Back" if you want to search around for other solutions as well. Most seem to be reliant on the language of choice, so you may have to do some digging of your own to find a solution that meets your needs.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

I see you found a solution for your question. I've restored your OP and if it's ok, I would like to keep it here in case others come in with a similar problem. Thanks.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 131 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.