Wrap script in function loadAJAX