Solution to ReferenceError: ajaxurl is not defined
Sometimes we face “ReferenceError: ajaxurl is not defined” while working with ajax in wordpress. Ajax will not work in this case and we will get this error while checking console by inspecting our browser. Simple solution to resolve this issue is given below.
source Solution :
By putting this code will resolve this problem. Enjoy ajax in wordpress 🙂