title: JavaScript alert is not working
body: <p>I have tried many ways to make JavaScript alert pop up but it is not working.</p>
  
  <p>My website is in SilverStripe 3.1. I am using jQuery. </p>
  
  <p>There is no error in the JavaScript file or the web console. The JavaScript file has loaded on the page. All mt other functions (.remove, .ajaxbtn, .gotocart, and checkout) work correctly. Only the alert call does not work.</p>
  
  <p>Here is my JavaScript file: </p>
  
  <pre><code>(function($)
  {
      $(document).ready(function() 
      {
          $('.ajaxbtn').on( 'click', function() 
          {
              event.preventDefault();
              var link = $(this).attr('href'); 
              var request = $.ajax(
              {
                url: link,
                type: 'GET',
                dataType: 'html'
              });
              $('.ajaxbtn').ajaxSuccess(function()
              {
                  alert('AJAX request successfully completed');
              });
              alert('AJAX request successfully completed');
          });
  
          $('body').on( 'click', '.remove',function() 
          {
              //event.preventDefault();
              var link = $(this).attr('href'); 
              //console.log(dataid);
  
              var request = $.ajax(
              {
                url: link,
                type: 'GET',
                dataType: 'html'
              });
          });
  
          $('body').on( 'click', '.checkout', function() 
          {
              //event.preventDefault();
              var link = $(this).attr('href'); 
              //console.log(dataid);
  
              var request = $.ajax(
              {
                url: link,
                type: 'GET',
                dataType: 'html'
              });
          });
  
          $( '.gotocart' ).click(function() 
          {
  
              alert('asdasdas');
              var link = $(this).attr('href'); 
              var request = $.ajax(
              {
                url: 'member-area/product-page-2/product-gallery/OrderedTemplate/',
                type: 'GET',
                dataType: 'html'
              });
              request.done(function( msg ) 
              {
                  $('.cartcontent' ).replaceWith(msg);
              });
          });
      });
  }(jQuery));
  </code></pre>
  
  <p>Here is the html for my buttons:</p>
  
  <pre><code>&lt;button class="ajaxbtn btn btn-primary" href="$Top.Link(Cart)?id=$ID"&gt;Pick&lt;/button&gt;
  &lt;button class="remove btn btn-primary" href="$Top.Link(RemoveItem)?id=$ID"&gt;Remove&lt;/button&gt;
  &lt;button class="checkout pull-right btn btn-primary" style="margin-right:10px;" href="$Top.Link(CheckOut)?id=$ID"&gt;Check Out&lt;/button&gt;
  &lt;button class="gotocart pull-right btn btn-primary" style="margin-right:20px" href="$Top.Link(gotoCart)"&gt;Go to cart&lt;/button&gt;
  </code></pre>