AJAX Post from same domain to a wordpress page

First, WordPress has a built-in way to handle AJAX requests, you should read this page and use that method instead.

The issue with your method is that you’re POSTing the name var. name is a WordPress query var, and is causing WordPress to query for a page with slug John. Always prefix your vars with a unique string to avoid these problems.