The solution to my problem is to:
- Add actions and create a function in
functions.php
. - Create an empty block in
display-location.php
. - Append the response from
jQuery.ajax
insuccess
function to previously created empty block.
I hope this will help someone in the future (final code is inside the edited question itself).
Thank you.