2

I have a problem with my web app. I use Jqtouch to develop it but I don't know how to detect when a button is tapped. This is part of my code and it doesn't work.

HTML:

<ul class="edit rounded" id="campi" name="campi"> 
    <li><input type="text" name="name" placeholder="Username" id="some_name" autocorrect="off" autocomplete="off" /></li> 
    <li><input type="password" name="name" placeholder="Password" id="some_name" autocorrect="off" autocomplete="off" /></li> 
</ul>                        

<a id="submit" name="submit" class="submit">Accedi</a>

Jquery code ( not working ) :

$("#submit").tap( function() {
    alert('Test');
});

Please help me fix. Thanks!!

4
  • Are you using a framework? Even though you have a web app you can still handle gestures including taps with UIGestureRecognizer. developer.apple.com/library/ios/#documentation/uikit/reference/… Jun 9, 2011 at 19:57
  • Hi! Thanks for your reply. i'm not developing an app whit xcode, i'm developing it whit JQtouch, a framework based on jQuery ( Based on javascript ). Thanks! Jun 9, 2011 at 20:43
  • @rohit Thanks, but it doesn't do anything even if i changed it :( Jun 10, 2011 at 15:52
  • 1
    Do you know how to program using Objective-C? I'm just curious why you wouldn't use it, it's very easy Jun 13, 2011 at 19:00

1 Answer 1

1

Try $("#submit").click(function (){ alert('Test'); });. Tap is a kind of click on any dom element iphone.

1
  • Thanks, but it doesn't do anything even if i changed it :( Jun 10, 2011 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.