Browser history

23 views
Skip to first unread message

fmpwizard

unread,
Nov 22, 2010, 10:57:49 AM11/22/10
to Lift
Hi,

The Lift application I'm currently working on basically displays
information about different test results we run at work. You enter a
version number in a search box, and you see the details.

So far this is working well, but I'd like to give our users the option
to enter a version number, hit search and then be able to copy the
url, and send that url to another coworker, so that they can both see
the same results. Instead of having to tell the second person, "go and
search for this version result"
While this sounds like it may not be so hard for the end user, I'm
planning on adding more search filters, etc, which would end up taking
too long for every user to do before then can talk about it.

I know some other frameworks add tokens to the end of the url after a
# . I wonder if this is somehow implemented on Lift or what your
thoughts are.

Thanks

Diego

David Pollak

unread,
Nov 22, 2010, 11:00:41 AM11/22/10
to lif...@googlegroups.com

Anything after the # is for the browser only... it's not communicated to the server.

If you want query parameters, you can do something like: http://localhost:8080/mypage?thing=my_thing

And you can get the parameter via S.param("thing")

 

Thanks

 Diego

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

fmpwizard

unread,
Nov 22, 2010, 11:55:20 AM11/22/10
to Lift


On Nov 22, 11:00 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> On Mon, Nov 22, 2010 at 7:57 AM, fmpwizard <di...@fmpwizard.com> wrote:
> > Hi,
>
> > The Lift application I'm currently working on basically displays
> > information about different test results we run at work. You enter a
> > version number in a search box, and you see the details.
>
> > So far this is working well, but I'd like to give our users the option
> > to enter a version number, hit search and then be able to copy the
> > url, and send that url to another coworker, so that they can both see
> > the same results. Instead of having to tell the second person, "go and
> > search for this version result"
> > While this sounds like it may not be so hard for the end user, I'm
> > planning on adding more search filters, etc, which would end up taking
> > too long for every user to do before then can talk about it.
>
> > I know some other frameworks add tokens to the end of the url after a
> > # . I wonder if this is somehow implemented on Lift or what your
> > thoughts are.
>
> Anything after the # is for the browser only... it's not communicated to the
> server.
>
> If you want query parameters, you can do something like:http://localhost:8080/mypage?thing=my_thing
>
> And you can get the parameter via S.param("thing")
>

Thanks for your answer, I missed to say that I am doing ajax post on
this search, to avoid a whole page reload, so I was hoping that I
could continue to do that and somehow add the #s=<version> to the url,
and that once the other user pastes that url, lift would know (well, I
need to tell it how to interpret that), what page to load and what to
do.

Does that make sense ?

Again, thanks for such a great framework.

Diego

>
>
>
>
>
>
>
>
>
>
> > Thanks
>
> >  Diego
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lif...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890

sorenbs

unread,
Nov 22, 2010, 1:32:04 PM11/22/10
to Lift
One - albeit lowtech - approach would be to have a button that will
generate a permanent link and display it to the user. Google uses this
approach in docs and maps.

fmpwizard

unread,
Nov 22, 2010, 1:38:58 PM11/22/10
to Lift


On Nov 22, 1:32 pm, sorenbs <sore...@gmail.com> wrote:
> One - albeit lowtech - approach would be to have a button that will
> generate a permanent link and display it to the user. Google uses this
> approach in docs and maps.
>

Yes, I thought about that approach, while not ideal, it will do the
job. Maybe if I find the time (and I figure out how) I could give it a
try to write a module that would do what I'm asking.
I'll post back if I get anywhere :)

Thanks


Diego

Alex Black

unread,
Nov 22, 2010, 1:42:06 PM11/22/10
to Lift
Without having dug into the details, the way to do this on the "web"
is to give each thing a url.

So, just make sure that each search result has its own url, then
people can share urls, bookmark them, etc. Thats how the web is meant
to work, and it seems we sometimes forget that.

If you are doing the search client-side, then appending "#" tokens is
the way to go. To implement this properly you'll need to have code
that runs when the page loads, and processes which ever token is on
the end of the URL.

- Alex

Florian Hars

unread,
Nov 24, 2010, 6:30:10 PM11/24/10
to lif...@googlegroups.com
Am 22.11.2010 17:55, schrieb fmpwizard:
> Thanks for your answer, I missed to say that I am doing ajax post on
> this search, to avoid a whole page reload, so I was hoping that I
> could continue to do that and somehow add the #s=<version> to the url,
> and that once the other user pastes that url, lift would know (well, I
> need to tell it how to interpret that), what page to load and what to
> do.

That has prima facie nothing to do with lift, handling of the part after
# is purely up to the browser, so you should do it with clientside
javascript. Two minutes with google brought up this page, which seems to
address the problem:

http://ajaxpatterns.org/Unique_URLs

Having standard code for this in lift might still be worthwhile, though.

- Florian.

Reply all
Reply to author
Forward
0 new messages