ajax calls, events not working.

ajax calls, events not working.

Hi, I'm new to the forum and have come to my first halt with JQM. I'm trying to make a ajax post to my nodejs Express 3 server. I have two input boxes and submit button. I cant get events to trigger and I have yet to get to see if the post will work. here's my code.
I tried Both
  1. $("#submit").live("click tap", function (event, ui) { alert('hello!!'); });
  2. $(document).ready(function () { $('#submit').click(function () { alert('clicked') $.ajax({ type: 'POST', url: '/login', data: { username: $('#username').val(), password: $('#password').val() }, dataType: "json", success: function (response) { $('#welcomeButton').text('Hi,' + response[0].username); } }); }); });

This is my form:

  
  1. a(href="#loginpopup", data-rel="popup", data-role="button",style="font-size:12px;float:right") Login
  2. div(data-role="popup", id="loginpopup")
  3. div(data-role="content")
  4. label(for="username") Username:
  5. input(type="text", name="username", id="username", value="")
  6. label(for="password") Password:
  7. input(type="password", name="password", id="password", value="", autocomplete="off")
  8. a(id="submit", type="button") Login