Use requirejs and jquery-mobile.