Will schrieb: > Hi, > > Is there a way to create direct links to a remotely called piece of > content on a page that uses the history/remote plugin? How about in a > 'pretty' way? > > For instance, if I'm putting together a page that has remotely loaded > content for red widgets, green widgets and blue widgets is there a way I > can load the green widget content block via url? It seems like it's all > there but I'm just missing it. when I try to go to > mysite.com/widgets.html#widget-2 > <http://mysite.com/widgets.html#widget-2>, I get my empty container. > When I'm on widgets.html and click the second widget link, the url comes > up as /widget.html#widget-2 > > this leads to another question. presuming I'm just missing something, > is there to get the history/remote plugin to do 'clear urls'? like, I'd > much rather the bookmark be at least widgets.html#green-widget instead > of using it's global prefix param. > > Thanks for any help! > > Will > > > ps. I grabbed source from http://www.stilbuero.de/jquery/history/ via > view source. is there a different source I should be using? Is there > an unpacked version around?
Hi Will, the unpacked version can be found here: http://dev.jquery.com/browser/trunk/plugins/history_remote/jquery.history_remote.js?format=txt What exactly do you mean by "clear urls"? You can already define your own hash prefix you'd like to use, like: $('a.remote').remote('#output', { hashPrefix: 'widget' }); You could than use that for each link as a workaround: $('#nav-green-widget').remote('#output', { hashPrefix: 'green-widget' }); $('#nav-red-widget').remote('#output', { hashPrefix: 'red-widget' }); and so on. You could do that in a loop more automatically. Say your links all have an id of some kind, like in the example above: $('a.remote').each(function() { $(this).remote('#output', { hashPrefix: this.id.replace('nav-', '') }) }); That would still result in a hash in the URL like: #green-widget-1 If thats not good enough, I have to think of a another solution to specify a certain hash, like for example automatically derive it from the links id or maybe even its URL somehow or provide it as an aditional option. Let me know. -- Klaus _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
