• Hi,

    the Codex describes ajax-handling on this page: https://codex.www.ads-software.com/AJAX_in_Plugins

    I succeeded in using ajax in the backend but I have problems with using ajax in the frontend. The article describes that the “ajaxurl” javascript global does not get automatically defined in the frontend, so I have to to it. But how to do that?

    The description of the codex-article is not very detailed there. The cited blog post “5 tips for using AJAX in WordPress” does not help me because it is very difficult to unterstand.

    To get precise, all i want to do is the following: when the user klicks on a button in the frontend, get some html depending on form entries and database response and get this html shown dynamically with js.

    I would appreciate some help here and would love to enlarge the codex-article in return.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter marsev

    (@marsev)

    No ideas? (*push to top*) Thanks ??

    What are you trying to do in the frontend, can you add the link of the website you are working on?

    Thread Starter marsev

    (@marsev)

    I have a button in the frontend. After klicking that button I would like wordpress/php to spit out some html which I can than display dynamically with js. The functionality should be embedded in a page-template.

    Quite the same behaviour is easy to develop in the backend because the js-global “ajaxurl” is already set. But in contrast it is not set in the frontend.

    The link is: https://www.bundjugend.de/termine/ There is a form, where I can filter entries that are shown below that form. The functionality is by now implemented with new loading the whole page. I would love to replace that with ajax.

    Thanks for help.

    I have the same problem..

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem with using ajax on frontend’ is closed to new replies.