Page 1 of 1

Is there a way to change page names in PHP/AJAX driven site?

Posted: Sun Dec 14, 2008 10:03 am
by raindance
Hi
I am, unfortunately, not versed in PHP, but am working with a programmer who is. We have developed a travel site where he used both PHP and AJAX for hotel/travel search functions, and I did the design part of the site in Dreamweaver based on a template I designed.

The site works great so far with one glaring problem that's driving me nuts but the programmer says can not be solved if we are to leave the AJAX in place.

The problem is, because he implemented pagewrapping (intentionally for functionality as I understand) the name of the page stays the same all the time, regardless of what the user is actually doing, which I think is a very bad user experience.

For example, user is on spahotels page, then does a search from the hotel search function in the left nav which is on all pages. Let's say he searches for Tokyo business hotels. The results will show up "on" the spahotels page, so the title and url still say spahotels.php while the content he is looking at is entirely unrelated. I think this is a bad user experience.

The programmer suggested that I look for a javascript to change the page name...does this make sense? Is there a better way to handle this issue? He says he spent two days making it work in pagewrapping and is not too happy that I don't like the page name staying the same issue...but it just makes no sense to me that the user keeps seeing spahotels when he is looking at hotels in tokyo.

The page if you want to see an example is
http://www.bluehippotravel.com/spahotels.php
-obvoiusly you will see it is rough...we are still working on it.

Thanks so much in advance for your help!

Re: Is there a way to change page names in PHP/AJAX driven site?

Posted: Sun Dec 14, 2008 9:10 pm
by infolock
For a user experience, yes this is actually kind of bad. Of course, there are Workarounds, Libraries, and tricks, but in this case, I'd recommend just doing a page load. It's kind of silly to try to do the entire site in one page unless you're doing something like flash sites...

that's my own personal opinion. others may find that using ajax to load and use the entire site on one page is great. i personally don't.


More than likely (and this isn't to bash your developer at all, because I know where he's coming from), more than likely he has written this application surrounding the idea of using ajax to load everything on one page. Doing so is very dangerous for a developer. Not because of security (then again, I haven't seen his coding...), but because doing so requires writing in a whole new dimension. Now everything you would normally do on page load is done through ajax requests, meaning he probably has a huge javascript file that does all this ajax stuff, and then another file that does all the pageContent crap, and on and on. With this in mind, he probably just doesn't want to have to start from scratch and rewrite the whole site (which is what will probably be required if you don't like what's going on). Either way, he should ahve ran this by you if this is indeed his "ideas" of how it should work. Sounds to me like he kinda waited until the project was done to show you how it works ;) If this is the case, that sucks.

Ajax should be used sparingly imo, and not necessarily for page navigation. using it to submit a form, populating multiple dropdowns, or other dynamic elements I can see as a benefit. You could, of course, use the above tricks above to make it work, but I am a firm believer in separating page actions, and directing to a new page (in this case, search.php instead of just the one file) when needed.

but like i said. everyone has their own ways.

Someone will have to give though in this case...