This line:
$("#GrayBackground").css({'height':'1900px','display':'inline'});
uses jQuery (via the $ function), which is a library that you should include on your page if you want this line of code to be there.
Put this at the top of the page to check:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
It is worth noting that if you want to accept jQuery - in many cases this is a good idea, you can use it to simplify a bunch of things, including the AJAX request that you are doing now manually.
source share