Jump to content

ajax and linking/bookmarking/history


GuardianGI

Recommended Posts

this is more of an AJAX related issue so I'm not entirely sure if this is where I should put it, anyway...

I want to load articles/pages etc. using AJAX into my main page and ofcourse have my content div change if someone clicks to load a new page (you know basic AJAX...)

the problem is I want to display a different URL path to my users browser everytime the page is changed using AJAX.

I've already set up a way to load my pages entirely if JS (or the AJAX function) isn't working however now I want that page's url to be displayed in the URL bar, to be added to the browser history etc. is there a (good) way of doing all this?

or would it be better to just ditch the AJAX and load the custom pages even on systems that support AJAX?

Link to comment
Share on other sites

yes but can I use javascript to in this case add something to browser history and edit a displayed url?

 

I want my users to be able to link some one to the page they are on simply by copying it form the url bar, I want hem to be able to use their history to navigate back I want them to be able to bookmark using their browsers bookmark functions.

 

I am very much afraid the easiest way of doing this would be to not use AJAX at all to load pages :'(

I can still use it for submitting forms etc. but I'd like to load main content with it as well but I don't want any functionality to be lost...

 

Link to comment
Share on other sites

sorry for double post but I can't find the edit button  :shrug:

any way all i could come up with by googling was this: http://onjava.com/pub/a/onjava/2005/10/26/ajax-handling-bookmarks-and-back-button.html?page=1

which IMO is a dirty fix that doesn't even solve all my problems.

 

I basically want the browser to think the page listed in the href was loaded (which it in fact was but by only getting a part from it using AJAX and ignoring all the unchanged stuff)

but i think the easiest way to make the browser think this is by in fact letting it load the page, however I would like to know if it is possible to do things differently.

I can imagine it is not because it could posse a security risk for users of browsers that would allow this(display a malicious site that looks like Google and display google.com in url bar would make it rather hard for an end user to know they are in fact not on Google xD)

 

but I figured it was worth asking anyway ::)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.