Going back to the previous page within the frame

Having trouble? Something not working as it should? Look here.

Going back to the previous page within the frame

Postby mugzmalone » Fri Apr 09, 2010 7:49 pm

I made a search for "any distance." The first frame brought up my city. I can click within that frame and go back to the list again with frame. I can then go down to the second frame and look at the next city. Still works fine.

Here's the problem: If I close out the top frame, then I cannot go back when I click a link within a subsequent frame. First click to go back does nothing, second click returns me to the home page. I am using the latest version of FireFox. This is probably something you have to fix, but if there is something I can do about it, please let me know. Thank you.
mugzmalone
 
Posts: 2
Joined: Fri Apr 09, 2010 7:41 pm

Re: Going back to the previous page within the frame

Postby Searchtempest Nathan » Fri Apr 09, 2010 8:21 pm

Huh! Indeed, I'm seeing the same thing. Thanks for summarizing it so thoroughly - recreating the problem is half the battle.
I'll look into it and hopefully get it fixed soon.
----------------------------------
Search Tempest Nathan
http://www.searchtempest.com
Searchtempest Nathan
Site Admin
 
Posts: 570
Joined: Fri Apr 18, 2008 10:06 pm

Re: Going back to the previous page within the frame

Postby Searchtempest Nathan » Fri Apr 09, 2010 11:13 pm

Aaaand 2.5 hours of unexpected work later... Fixed! ;)

Well sorta. Man was that a pain in the arse!

I doubt you're interested in this much detail, but just in case anyone is interested in the inner workings, here was the problem in detail:

By necessity, Searchtempest has to use a bunch of frames. That's one way we're able to show craigslist results without drawing their wrath. Since most websites don't use giant stacks of frames, I run into some fairly uncommon issues. In this case it's a bug in Firefox, and to a lesser extent in Webkit (Chrome and Safari). (Aside: this may be the only time ever that I've run into something at only IE does right..) The problem is that when you dynamically remove an iframe from a page, it messes up the browser's handle on which frame is which, causing the back button not to work for any frames further down on the page. (You may have noticed that if you closed a frame in the middle, the ones above it still work fine.)

Now, one solution would be to just hide the frames when they're closed, instead of fully removing them. The problem with that is that frames also take up a lot of memory. For large searches, people may open tens, or even sometimes hundreds of frames. So I don't only delete frames when you click the close button; I also delete them when you're no longer looking at them, then replace them if you go back. For example, once you're up to cities [61-80], cities [21-40] have been quietly removed in the background. If you go back to that page, they'll be loaded again. This ensures that things don't bog down on less than stellar computers.

So the end result is that I NEED a way to delete frames to save memory. Sooo instead of deleting the whole frame, I could just set its contents to nothingness. This solves both of the problems above, but it creates a new one. Setting the frame source to nothingness is counted by the browser as going to a new page. So it adds an entry in the history, and when you click the back button, it will undo that change. (ie it will reload a city in a frame which is now invisible, or from your point of view, perplexingly do nothing.) (edit: possibly not true if location.replace is used - may have to revisit this option)

So finally I came up with what I think is the best, although not ideal, solution. Basically I'm wrapping each frame in ANOTHER frame. This way I can delete the inner frame without mucking with the back button in the main page. Solves all the problems, but obviously adds a bit of bloat. Also, one minor issue that may still come up is if you click on an ad in a city, then close it, the back button won't work - that's because it's trying to back out of that ad, but the frame that it was opened in no longer exists. Unfortunately there's no work-around for that as far as I can see. It should be a pretty rare thing though.

Whew.

Once the current redesign is done (hopefully by the end of May), I'm going to take a look at whether I can display the results in a different manner. If I can manage it, it'll do away with problems like this, and hopefully make things a fair bit more user-friendly too.
----------------------------------
Search Tempest Nathan
http://www.searchtempest.com
Searchtempest Nathan
Site Admin
 
Posts: 570
Joined: Fri Apr 18, 2008 10:06 pm

Re: Going back to the previous page within the frame

Postby mugzmalone » Sat Apr 17, 2010 12:32 am

Thanks for the update. I will use it again!
mugzmalone
 
Posts: 2
Joined: Fri Apr 09, 2010 7:41 pm


Return to Help with Searchtempest

Who is online

Users browsing this forum: No registered users and 1 guest

cron