Thanks very much Klaus. I'm sorry, that was a typo. "Clear urls" should have been "clean urls" ala Apache's mod rewrite. That workaround should do the trick just fine. just like mod rewrite. ;) I appreciate it. I'll give it a go this afternoon. Having the hash is fine.
For what it's worth, I imagine basing the hash off the link's original href would be the cleanest default method or at least a nice option to have. It would closely match non-js enabled functionality which is one of the reasons I'm going with this plug: super clean, unobtrusive goodness! If we're using meaningful document names (we all are, right? :) ) then the bookmarks and direct links should work and read great. I'm actually using this to put together a client list page. I realize now, rereading my original message, that widget sales were a bad example because repeating 'widget' for 'widget-green' and 'widget-blue'is no big deal. But for a portfolio page, I'm looking more for "foo.com/clients.html#nike" and " foo.com/clients.html#ibm". I was looking for the source to see if I could at least hack out: "foo.com/clients.html#clients-nike" instead of having a number on the end like "#clients-1". Thanks for your time and thank you for this plugin. Will On 3/12/07, Klaus Hartl <[EMAIL PROTECTED]> wrote:
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/
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
