Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Placemarker in Ajax text

Status
Not open for further replies.

jaschulz

Programmer
May 20, 2005
89
FR
Given a div containing several anchors, and another div where text (i.e. relatively long text, several screens at least) is loaded via Ajax when one of those anchors is clicked, is it possible to remember (only for the current session) the current position in one of those ajax texts so that the user can switch to another one and then return to where he/she was in the first one?

Thanks,

JAS
 
Sure. You might do this by outputting a <span id="currentPosition"></span> block in the AJAX delivered output and then move to that by use of #currentPosition in the anchor.

I'm sure the details will need to be massaged for your specific scenario - but you get the picture.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
I think I get the picture, but it seems awfully complicated. Wouldn't I have to save the current AJAX text (with its current position span) back to the server each time the user called for a different text? And, at the end of the session, wouldn't I have to reopen each text used during that session and delete its current position span?

JAS



 
...but it seems awfully complicated
Yes... it does... but that reflects the problem itself [smile]

I don't really know the specifics of your set up - nor why you would require this in the first place. Unless it's already a business requirement, maybe it's better to leave it be and focus on something that offers clear value?

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top