title: Send request to server Using ajax
body: <p>Hi i am trying to send request and want to hit my url on button click but it is not working</p>
  
  <p>updated code</p>
  
  <pre><code>    &lt;script&gt;
  $(function(){
  
        $("#submit").click(function(){
  var sms="url/sendmessage.php?user=""&amp;password="&amp;mobile=7828208357&amp;message=hello&amp;sender=&amp;type=3INFORM";
  
      $.ajax({        
          url: sms ,
          data: "message=",
          type: 'POST',
          success: function (resp) {
              alert(resp);
          },
          error: function(e){
              alert('Error: '+e);
          }  
      });
        });
  
  });
  &lt;/script&gt;
  
  &lt;input type="submit" value="submit" name="submit" id="submit"&gt;
  </code></pre>
  
  <p>Here given url i want to hit on button click How can i achieve this</p>
  
  <p>Any help will be appreciated</p>