[jQuery] Re: Intercept "Back" button click on browser

2008-10-10 Thread David Durham, Jr.
On 9/30/08, Leanan <[EMAIL PROTECTED]> wrote: > How can I make it so that when the user clicks the back button in > their browser, this same thing happens, as I'll likely have people > trying to click the back button instead of the back link on the "page" > and then tell me it's broken. Is it

[jQuery] Re: Intercept "Back" button click on browser

2008-10-10 Thread Leanan
Via more investigation, I think I've come across the issue. The question is whether this is a bug / needed feature. It appears that when you use $.history, the click happens twice -- once when you click on whatever you want to click that triggers some jquery and secondly when the history plugin

[jQuery] Re: Intercept "Back" button click on browser

2008-10-10 Thread Leanan
Well, originally I had thought that the duplication went away. It appears now that the duplication only happens when I load datasets that are longer than (some yet to be determined) length / time. I was browsing through the code of the plugin and I noticed there was some timer stuff added for Op

[jQuery] Re: Intercept "Back" button click on browser

2008-10-09 Thread Klaus Hartl
On 8 Okt., 18:57, Leanan <[EMAIL PROTECTED]> wrote: > The duplication is something else. > > However the fix you made works. That means you still have that duplication? Or not? --Klaus

[jQuery] Re: Intercept "Back" button click on browser

2008-10-08 Thread Leanan
The duplication is something else. However the fix you made works.

[jQuery] Re: Intercept "Back" button click on browser

2008-10-08 Thread Leanan
Fantastic, thank you. Where might I be able to get this? Also, it seems sometimes that even though I'm using $('a#myidxxx').history(function() { $.get(myurl,function(data) { $(myappenddiv).append(data); }); }); that the data is still getting appended twice. This doesn't happen all th

[jQuery] Re: Intercept "Back" button click on browser

2008-10-08 Thread Klaus Hartl
On 7 Okt., 17:50, Leanan <[EMAIL PROTECTED]> wrote: > All right... > > I've found a solution to the problem, though it is not the solution I > had hoped for. > > I basically had to do a $.getscript and generate script that had a $ > (selector).history() for each link.  Not ideal, but it works.

[jQuery] Re: Intercept "Back" button click on browser

2008-10-07 Thread Leanan
All right... I've found a solution to the problem, though it is not the solution I had hoped for. I basically had to do a $.getscript and generate script that had a $ (selector).history() for each link. Not ideal, but it works. I do wonder though if I was doing something wrong in my calls

[jQuery] Re: Intercept "Back" button click on browser

2008-10-07 Thread Leanan
I forgot to note that when I do a console.info(this) inside that function, I get the following in firebug: Window index.html

[jQuery] Re: Intercept "Back" button click on browser

2008-10-07 Thread Leanan
In that situation, 'this' does not appear to be a reference to the link we've clicked, and when I use firebug and do some console output, this is what I get: this.id = undef /\d/.exec(this.id) is null I had actually tried something along those lines before, changing my click handler on the links

[jQuery] Re: Intercept "Back" button click on browser

2008-10-07 Thread Klaus Hartl
Nevertheless you are using the plugin in a way it isn't supposed to be used, this is what I wanted to point out and this is where the double loading comes from. One from the click handler itself and a second time because that click event is triggered again by the plugin. Besides if you're not usin

[jQuery] Re: Intercept "Back" button click on browser

2008-10-07 Thread Leanan
Not having a test for Chap3 was a typo. That last if should be adjusted accordingly. Klaus- I don't want to use .remote, because I only want to make the ajax call once. If the content we expect to be there isn't there, then I want to load it. If, however, we've already loaded it, I just want

[jQuery] Re: Intercept "Back" button click on browser

2008-10-06 Thread Klaus Hartl
History/Remote is not supposed to work that way. Although the hash is changing correctly it will not work in IE for example. You need to explicitly tell the history manager which links add to history. Just have a look at the demo. For pure Ajax loading links that is the remote method. In your case

[jQuery] Re: Intercept "Back" button click on browser

2008-10-06 Thread Bil Corry
Leanan wrote on 10/6/2008 3:52 PM: > You should notice that every time you click on the Test links, you > will actually get the html page twice instead of once. You test for Chap1 twice in the IF statements and you don't test for Chap3 at all. I suspect that would cause a double-load issue for

[jQuery] Re: Intercept "Back" button click on browser

2008-10-06 Thread Leanan
Klaus, I've created a demo that exhibits this behavior. I modified your demo that is included with the script at http://www.stilbuero.de/jquery/history/ All you should have to do is change your index.html to be the following: jQuery history/remote - solution for

[jQuery] Re: Intercept "Back" button click on browser

2008-10-06 Thread Leanan
I'll see if I can create a demo that has the same behavior. On Oct 6, 4:25 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote: > Is it possible for you to put up a demo? > > --Klaus > > On 6 Okt., 22:11, Leanan <[EMAIL PROTECTED]> wrote: > > > *sigh* > > > Ok.  I've decided upon the jquery.history_remote.

[jQuery] Re: Intercept "Back" button click on browser

2008-10-06 Thread Klaus Hartl
Is it possible for you to put up a demo? --Klaus On 6 Okt., 22:11, Leanan <[EMAIL PROTECTED]> wrote: > *sigh* > > Ok.  I've decided upon the jquery.history_remote.js plugin by Klaus. > I have it working, except there is one slight problem, and I can't > figure out how to fix it. > > I have a ta

[jQuery] Re: Intercept "Back" button click on browser

2008-10-06 Thread Leanan
*sigh* Ok. I've decided upon the jquery.history_remote.js plugin by Klaus. I have it working, except there is one slight problem, and I can't figure out how to fix it. I have a table of links that, when you click on a link, they pull up more detailed data, load it into a div, so on and so forth

[jQuery] Re: Intercept "Back" button click on browser

2008-10-05 Thread Dave Methvin
The history plugins can handle that situation, you just have to update the hash in the URL to keep track of the state of the page. It takes some study to understand how it works, but believe me you will want to use it. There is no way to "trap" the back button, the only other thing you can do is s

[jQuery] Re: Intercept "Back" button click on browser

2008-10-03 Thread Leanan
I've looked at the plugins, but I don't think they are what I want. I basically have two divs, div#a and div#b. When I click on a link in div#a, I want to do one of two things: If this is the first click on the link in div#a, do some ajax and then hide div#a and show div#b (where the ajax stuff

[jQuery] Re: Intercept "Back" button click on browser

2008-09-30 Thread Bil Corry
Leanan wrote on 9/30/2008 10:10 AM: > How can I make it so that when the user clicks the back button in > their browser, this same thing happens, as I'll likely have people > trying to click the back button instead of the back link on the "page" > and then tell me it's broken. Is it even possibl