Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var contact= {
- send: function() {
- $.ajax({
- type: "POST",
- url: "ws/ContactService.asmx/SendEmail",
- data: '{"fromEmail":"' + $("#email").val() + '", "fromName":"' + $('#name').val() + '", "subject":"' + $('#subject').val() + '", "message":"' + $('#message').val() + '"}',
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- error: function() {
- alert("Error");
- },
- success: function(msg) {
- alert(msg.d);
- },
- complete: function() {
- $("#send").text("Send");
- }
- });
- }
- };
- $(document).ready(function() {
- $("#send").("click", function() {
- $("#send").text("Sending...");
- contact.send();
- });
- }
- );
- var contact = {
- inprogress: false,
- send: function() {
- if (contact.inprogress)
- return;
- contact.inprogress = true;
- $.ajax({
- ...
- complete: function() {
- $("#send").text("Send");
- contact.inprogress = false;
- }
- });
- }
- };
Add Comment
Please, Sign In to add comment