Navigation: getAjaxFormData: Simplify code.

Idea from: https://github.com/jquery/jquery-mobile/commit/0d4e839#commitcomment-2811047
(cherry picked from commit 0f5f2902bc0d8d54d4e1b50e955a9d868a11c742)