IE history menu

2 views
Skip to first unread message

Aryeh Leib Taurog

unread,
Nov 29, 2007, 4:19:45 AM11/29/07
to ReallySimpleHistory
It's neat to see all the new activity around this very useful
library! I only started using it in the last few months, in an AJAX
search framework I'm building for a client organization.

I post the solution I found for a small problem I ran across:

Background: My search app allows a user to search various record bases
according to various search criteria, i.e. people by last name, date
of first contact, id, and so forth. When the user executes a search,
I set the document title to reflect the search criteria:
"Coordinators Last Name Brown"

The problem: IE's drop-down history menu doesn't show the main
window's title, but that of the page loaded in the iframe. So instead
of my dynamically generated user-friendly titles, one gets the url for
the iframe source, which isn't very useful to the user.

Solution: I added the following line to the pageLoaded function in
blank.html:
document.title = window.parent.document.title;

This more or less does the trick. There is one problematic edge
condition, which is what happens when revisiting a bookmarked search.
I get the generic title instead of the descriptive title for that
search. If I understand correctly, this is because I can't properly
set the title until my history handler is called, which doesn't happen
until after blank.html is loaded in the iframe.

Perhaps in this case I could add a second page to the history once
I've properly set the window title. If I'm more clever, I could try
calling the parent frame's title-generating code directly from the
pageLoaded function in the iframe.

In any case, the generic "Search" title is still much better than the
blank.html url, and I may just live with the edge case.

Incidentally, there seems to be another side-effect of using the
iframe in IE which I imagine would be much more difficult to work
around. That is that as long as the user stays on my AJAX search
page, all the AJAX searches performed appear in the history menu.
However, as soon as the user navigates away from the page, the
searches disappear from the menu and only the last search performed
appears in the history menu. The individual searches do reappear,
however, if the user backs up to the search page again.

IE's history sidebar only registers the hit on the main AJAX page, and
none of the searches.

Aryeh Leib Taurog

mctrivia

unread,
Nov 29, 2007, 10:20:08 AM11/29/07
to ReallySimpleHistory
If you create a function lets call it
openPage(hash)
that generates a page based soley on the hash value you can add

openPage(dhtmlHistory.getCurrentLocation());

to the end of the window.onload function and have the page generated
from a bookmark or manual entry including the nice title you want to
be there. Requires you hash all necisary data instead of using data
variable.

bdpath...@gmail.com

unread,
Dec 11, 2007, 12:35:46 PM12/11/07
to ReallySimpleHistory
See this thread for more info on this topic:

http://groups.google.com/group/reallysimplehistory/browse_thread/thread/3e4bf26e431393f8

On Nov 29, 9:20 am, mctrivia <squarerootofnegative...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages