How to disable a page on ajax request
<p>Hi my requirement is show loading spinner and page get disable and non clickable when ajax request is send for this I have included given code</p>

<pre><code>$('#expressShippingCalculation input').change -&gt;
if $('#shipping_method4').is(':checked')
  additionalAmountExpress()
  data = $('#shippingDetails').serialize()
  expressValue = true
else 
  $('#additional-charge').hide()
  expressValue = false
$.ajax
  url: '/update_express_shipping?expressShipping=' +expressValue
  type: 'PATCH'
return

$(document).ajaxStart -&gt;
  $('#spinner').show()
  return
$(document).ajaxComplete -&gt;
  $('#spinner').hide()
  return
$(document).ajaxError -&gt;
  $('#spinner').hide()
  return
</code></pre>

<p>with the above code snippet ajax loader is working but my page does not get disable when spinner is loading. Please guide me how to disable page when ajax is loading.</p>