title: Microsoft JScript runtime error: Function expected
body: <p>i have the following javascript function with some jquery in it. When I call the <strong>createAppointmentConfirm</strong> function, it tries to call the <strong>SendMail(id)</strong> function but throws an error:</p>
  
  <blockquote>
    <p><strong>"Microsoft JScript runtime error: Function expected"</strong></p>
  </blockquote>
  
  <p>And Firefox debugger throws an error:</p>
  
  <blockquote>
    <p>SendMail is not a function [Break On This Error]
    SendMail(data.Message);</p>
  </blockquote>
  
  <p>Here is the code. Thank you for your help.</p>
  
  <pre><code>function createAppointmentConfirm(data) {
      if (data.Error) {
          alert(data.Message);
      } else {
          if ($('#sendMail').attr('checked') == 'checked') {
              SendMail(data.Message);
          }
          RefreshAppointmentList();
      }
  }
  function SendMail(id) {
      $.ajax({
          url: $('#sendMail').attr('title'),
          data: { id: id },
          type: "POST",
          beforeSend: function () {
              $('#sendingMail').dialog({ modal: true });
          },
          success: function (data) {
              if (data.Error) {
                  alert(data.Message);
              }
              $('#sendingMail').dialog("close");
          },
          error: function () {
              alert("Error sending mail");
              $('#sendingMail').dialog("close");
          }
      });
  }
  </code></pre>