Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ajax and address bar updates

 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm just timidly dipping my toes in the Ajax pool. I've got a web page that goes out and does fairly substantial database querying and processing. So its load time is longish, so it seems like a great candidate for Ajaxification.

What I've done is created a page that loads all the graphics and the menuing system and the form that contains the parameters for the report, and then contains a div that (on page load) contains nothing.

When I click the button in the form, it updates the div to contain "Report loading, please wait" and a spinning logo.

I'm using prototype to update the div with the report data, when it eventually arrives.

All this works great.

Now.... how do I get the address bar to update? I can't find anything in the prototype docs or even by googling. But then, I'm notoriously bad at googling.

I could attempt some javascriptery of my own, and I'm fairly certain it would be successful, but I'm wondering if there is a well-known Ajax solution to this well-known Ajax problem.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.pascarello.com/rememberHistory.aspx

Eric
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric, and thanks.

I did manage to find references to using the hash. My form contains about a dozen parameters, one of which might contain up to 15 values. I'm just wondering if this hash technique is a 'standard' way?

It seems a shame we have to abandon ?, which is then recognized by Java's request.getParameter(), and instead use #, which needs to be parsed by javascript. It's too bad we can't do window.location without it refreshing. I think I'm still stuck between paradigms.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can not change the URL of the page without causing the page to reload.

It is just like frames.

Eric
 
On my planet I'm considered quite beautiful. Thanks to the poetry in this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic