{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"closed","user":{"avatar_url":"https://secure.gravatar.com/avatar/b0765e35b9759af3a07de5af4bc479df?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b0765e35b9759af3a07de5af4bc479df","url":"https://api.github.com/users/arthurblake","login":"arthurblake","id":247797},"milestone":null,"assignee":null,"updated_at":"2011-11-08T14:06:00Z","labels":[],"comments":4,"closed_at":"2011-11-08T13:39:10Z","url":"https://api.github.com/repos/n1k0/casperjs/issues/3","body":"I think that there is a problem in the way that phantom.Casper.ClientUtiils.click is implemented.\r\n\r\nI am trying to use it to click on an element that looks like this:\r\n\r\n&lt;a href=\"#\" onclick=\"obj.doSubmit({action:'login'});return false;\"&gt;Login&lt;/a&gt;\r\n\r\nIn a regular browser, the link is really used just for styling, and the href is never followed because the handler returns false.  (Probably a bad way to code the page, but that's a separate issue and I'm not under control of the page.)\r\n\r\nThe way the casper click function is implemented, it's not taking into account that if the event handler returns false, the browser is not supposed to try to follow the href, but casperjs *does* follow the href which it's not supposed to do.  Also, casperjs is returning false to the client on the click function, even though the click itself was a success.\r\n\r\nDoes this make sense?\r\n\r\nBy the way, casperjs is an incredible project-- I'm really looking forward to working with it!!","html_url":"https://github.com/n1k0/casperjs/issues/3","number":3,"title":"casper.click problem","id":2157013,"created_at":"2011-11-06T17:36:08Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/b0765e35b9759af3a07de5af4bc479df?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b0765e35b9759af3a07de5af4bc479df","url":"https://api.github.com/users/arthurblake","login":"arthurblake","id":247797},"updated_at":"2011-11-08T14:06:00Z","url":"https://api.github.com/repos/n1k0/casperjs/issues/comments/2667742","body":"I'm not sure that you can really even detect that a click failed or not, unless you put a try catch around it and define \"fail\" to mean that a javascript exception was thrown.\r\n\r\nThink about sitting in front of a browser with a mouse, nobody reports to you whether your click failed or not.  Maybe the intention was to understand if the click was handled by an event handler (ie whether an event handler was defined and ran to completion.)  Even that is a tricky thing to really nail down, what with event bubbling and so forth...\r\n\r\nI will submit a pull request if I can come up with something that seems logical...","id":2667742,"created_at":"2011-11-08T14:06:00Z"}}