Blair
On 10/19/06,
Mike Alsup <[EMAIL PROTECTED]> wrote:
Klaus,
> $('a.hijax').history();
>
> jQuery.fn.history = function() {
> return this.each(function() {
> $(this).click(function(e) {
> jQuery.history.setHash ('#' + this.href.split('#')[1]);
> });
> });
> };
This is looking very nice. I like this usage pattern.
> Why not implement a better solution for being able to implement Hijax
> the easy way
> ... snip ...
> That concept would of course involve the back-end as well. There it must
> be decided upon the "X-Requested-With" request header what to send back
> (whole page or only the part of the page that needs to be updated.
I think this is the way to go. The original markup must have the
correct urls so that the page degrades. I would consider that a
requirement.
I think it is also a requirement to make sure it is easy to change the
href that gets loaded (which you've done). That way I could achieve
the desired results without X-Requested-With logic on the server.
Using templates or SSI I could structure my docs so that a call to
" mydoc.html" returns the full page and a call to "mydoc-p1.html"
returns paragraph one only. Using the plugin on your demo page I
could then rewire the anchor click events like:
...
$('#chapter').load('mydoc-p' + i '.html');
...
Mike
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
