Hi there,
That code is just a javascript and shouldn’t cause any freezing.
I’ll continue checking, does this happen before? Or is it only present in this staging site? How about trying it on a different host for staging?
I installed a new copy and it load and works, but just once. The issue is back after reloading, then I deactivated ninja form and it works again. Then the issue is back on every page reload. It feels like your site is unable to handle the theme and plugins at the same time, those other themes like twenty-fifteen is an empty theme, hence, it’s a bit faster to load but still slow. How about contacting your hosting provider and see if you can get any error or information? It’s like there is a problem with your host environment.
Thanks!