Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #14855

Re: Why is .click() not effective and requires us to press on Refresh?

From "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com>
Newsgroups comp.lang.javascript
Subject Re: Why is .click() not effective and requires us to press on Refresh?
Date 2012-07-04 15:15 +0200
Organization Sebastien Vauban
Message-ID <80d34bbras.fsf@somewhere.org> (permalink)
References <807guldukp.fsf@somewhere.org> <4ff335de$0$6179$ba4acef3@reader.news.orange.fr> <80wr2jbt4v.fsf@somewhere.org>

Show all headers | View raw


Hello,

> SAM wrote:
>> Le 03/07/12 12:09, Sebastien Vauban a écrit :
>>> I've made up an example of what I'm trying to achieve in
>>> http://jsfiddle.net/svajquery/ttVUA/4/.
>>>
>>> I have "tabified" all H2, and want to click on a link in the first tab
>>> ("Dashboard") and want to be redirected on the right place of the second tab
>>> ("Tasks").
>>>
>>> While the URL is correctly displayed in the address bar of the browser (at
>>> least when testing those files in a real browser environment), the .click() is
>>> not effective.
>>
>> the function click() can't work with a link (in "normal" JS) it was made for
>> buttons of forms (submit for instance)
>
> OK. Though, I'm not sure to fully understand, as it is clear that it does work
> in the following lines:
>
>           // set the right tab as current
>           $('#tabs > li a[href="#' + tabname + '"]').click();
>       }
>       else {
>           // set the first tab as current (on page load)
>           $('#tabs > li a').filter(':first').click();
>
>>> I must press on the Refresh button to really go where I want to.
>>>
>>> Do you have any explanation?  I surely miss something!
>
> I have a gut feeling that there must be a simpler way -- however, well
> beyond my JS debugging experience (simply above what I know from JS). Why do
> I think that? Because the first snippet of code (here above) works well with
> such links:
>
> - file.html sets the first tab as the current one
>
> - file.html#sec-2 (or file.html#tasks, if I would have given a more
>   significant name) sets the second tab as the current one (after an
>   eventual click on the browser's refresh button)
>
> - so does file.html#sec-2-1 (that is a link inside the second tab), with a
>   browser refresh
>
> So, such links (to individual tasks) are essentially correctly followed...
> but only after a browser refresh. That's the stumbling block.
>
> Does this help (for helping me ;-))?
>
> Thank you very much in advance for your help!

To ease answering on this, please find the current files used as example
there:

- http://www.mygooglest.com/sva/ecm-jumping-to-the-right-tab.html
- http://www.mygooglest.com/sva/ecm-jumping-to-the-right-tab.js

Best regards,
  Seb

-- 
Sebastien Vauban

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Why is .click() not effective and requires us to press on Refresh? "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> - 2012-07-03 12:09 +0200
  Re: Why is .click() not effective and requires us to press on Refresh? Gregor Kofler <usenet@gregorkofler.com> - 2012-07-03 14:26 +0200
    Re: Why is .click() not effective and requires us to press on Refresh? "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> - 2012-07-04 11:43 +0200
      Re: Why is .click() not effective and requires us to press on Refresh? SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-07-04 12:13 +0200
        Re: Why is .click() not effective and requires us to press on Refresh? "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> - 2012-07-04 14:37 +0200
      Re: Why is .click() not effective and requires us to press on Refresh? Gregor Kofler <usenet@gregorkofler.com> - 2012-07-04 13:58 +0200
        Re: Why is .click() not effective and requires us to press on Refresh? "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> - 2012-07-05 09:23 +0200
          Re: Why is .click() not effective and requires us to press on Refresh? Gregor Kofler <usenet@gregorkofler.com> - 2012-07-05 14:47 +0200
        Re: Why is .click() not effective and requires us to press on Refresh? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-07-05 16:48 +0200
  Re: Why is .click() not effective and requires us to press on Refresh? SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-07-03 20:11 +0200
    Re: Why is .click() not effective and requires us to press on Refresh? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-07-03 18:25 +0000
      Re: Why is .click() not effective and requires us to press on Refresh? Gene Wirchenko <genew@ocis.net> - 2012-07-03 13:16 -0700
        Re: Why is .click() not effective and requires us to press on Refresh? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-07-03 21:10 +0000
      Re: Why is .click() not effective and requires us to press on Refresh? SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-07-04 09:49 +0200
        Re: Why is .click() not effective and requires us to press on Refresh? SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-07-04 10:18 +0200
    Re: Why is .click() not effective and requires us to press on Refresh? "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> - 2012-07-04 14:36 +0200
      Re: Why is .click() not effective and requires us to press on Refresh? "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> - 2012-07-04 15:15 +0200

csiph-web