dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 12 of 12

Thread: Change page title on AJAX site...JS?

  1. #1
    Join Date
    Dec 2008
    Posts
    5

    Change page title on AJAX site...JS?

    I am building a travel site. I am a fairly basic but longtime DW user. I built the site in DW. I made a template and all pages are then based off the template. I hired a programmer to do the complicated hotel searching code. He says that he used AJAX and I know also php (all the pages are whatever.php)

    What I don't like and he says can not be changed, which there must be a workaround for, is that, for example, a user will be on the spahotels.php page. Or perhaps they are on the whatshot.php page reading the latest article about jungle treehouse eco lodges. So far so good, the name of the page is "spahotels.php" or "whatshot.php".

    But, on each (and all) of the site pages we also have a hotel search on the top left nav. So from any page, the user can do a hotel search. The problem I have is that...once they do this....the results they are given in the main window of the page, are totally unrelated to spahotels or whatshot about jungle lodges...so if they have now searched for tokyo business hotels, it looks ridiculous and confusing that the page name says "spahotels.php" and the page title says Find Great Spa Hotels.

    My programmer says AJAX was the best way to do the hotel search functionality (which I dont know anything about so if he says so maybe so but I don't know) but he also says there is no way to make the page name or title change to reflect what the user has done on the left search function. Makes sense..they are clearly unrelated.

    However...this is a terrible user experience in my opinion. So...one idea he had was to find a javascript code that changes the page title/name.

    Does anyone have some ideas of how to solve this issue?

    The page (rough, we are still developing) is
    http://www.bluehippotravel.com/spahotels.php

    Try doing a seach for something on the left nav hotel search...and see what I mean...the name of the page stays spahotels.php and the title stays Spa Hotels. I get it...I think...why it does...but it looks stupid if you are looking for something else in your search (which of course the user will be).

    Any ideas??? Thank you so much in advance!!

    Laura

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Welcome to DevX

    It looks like you are refreshing a frame on the page rather than the entire page.

    Why wouldn't you load a totally new page for each search?

    (Also, I think you OVER estimate the perception of users. Before responding to this, I showed your link to 10 different people and had them do a search. None of them noticed the page name had not changed. In fact, I probably wouldn't have noticed if I hadn't been looking for it.)

  3. #3
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    What about creating a new php page called "searchResults.php" which is the target whenever u search anywhere in the website .. ?
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  4. #4
    Join Date
    Dec 2008
    Posts
    5

    Thanks

    Good idea...thanks....will pass along to programmer.

    Also, interesting about ten people not even noticing...it drives me nuts but if no one even notices maybe you are right that it's not that big of a deal!

    Thanks for taking the time and for both replies.

  5. #5
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Quote Originally Posted by raindance
    but if no one even notices maybe you are right that it's not that big of a deal!
    I disagree with that. It is a big deal, it simply isn't something that you would need to get overly worked up about.

    Having said that, however, if for no other reason than professionalism it is something that needs to be addressed. I would liken it to taking the time to create a Help File for an application that, maybe, one user out of 100 users would ever look at. Yet, it still has to be created just like this still has to be fixed.

  6. #6
    Join Date
    Dec 2008
    Posts
    5
    I totally agree. He's working on fixing it today.

    Do you have a "best" approach to solve it?

  7. #7
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    If you ask 10 programmers what the "best" approach to solving an issue is you will get 20 different answers.

    None of them would be the "best", only the way they would do it. If it were me, I go with a totally new page to display the search results as opposed to displaying them in a frame on any one individual page.

  8. #8
    Join Date
    Dec 2008
    Posts
    5

    AJAX issue

    So the programmer solved the title thing easily but says he can not solve the url thing because it uses AJAX and that with AJAX it is simply impossible to open it in a a new page, such as you suggested.

    Somehow this does not seem right to me...why shouldn't it be able to open a new page called "searchresults.php"??

  9. #9
    Join Date
    Dec 2008
    Posts
    5
    He implemented your suggestion...thank you so much for the tip on how to do it....I really appreciate it!

  10. #10
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Quote Originally Posted by raindance View Post
    Somehow this does not seem right to me...why shouldn't it be able to open a new page called "searchresults.php"??
    You can....I would be interested in hearing the reason that you are being told you can't.

    (If you want to verify this for yourself, fire up Google, and in the search window type: open new page ajax

    Click on the search button.)

  11. #11
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    actually it's a bit confusing when u ask someone requesting data from AJAX to open the data in new page ... but it's pretty easier, just remove the AJAX and instead of requesting the data throw AJAX, go for it and make it the target page ...
    although it may seem for many ppl that this is a downgrade technologies, [i.e. removing AJAX after having it ...] but I don't think so, the main target now is having a more professional design, not using an extra technology not needed ... having the direct example here: google itself, the biggest website design mainly by AJAX, and its biggest thing "the search engine" is just targeting the results in a new page ... [called "search"]
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  12. #12
    Join Date
    Dec 2008
    Posts
    1
    thanks

Similar Threads

  1. Replies: 0
    Last Post: 08-30-2007, 03:51 PM
  2. Why use XML?
    By Brian in forum XML
    Replies: 5
    Last Post: 01-10-2003, 09:39 PM
  3. SITE RAIDER LAUNCHES
    By Chris McKie in forum xml.announcements
    Replies: 0
    Last Post: 02-20-2002, 02:36 PM
  4. Change page text
    By Sacha Crompton in forum Java
    Replies: 1
    Last Post: 11-27-2000, 10:20 PM
  5. Replies: 0
    Last Post: 08-31-2000, 05:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center