• Resolved Enri

    (@enriqueerrando)


    Hi,

    I’m not very good at coding, so I’m struggling a bit with this. I’ve tryed lots of suggestions out there, but cannot make it work.

    THE GOAL:
    I want to create a button that when clicked calls a php function that executes without loading the whole page, just the code inside it. Everytime u click on that button again, that AJAXIZED function reloads.

    THE ISSUE:
    The php function works, but I cannot make the button call that php function.

    WHAT I’V GOT SO FAR (simplified):

    I have a function that creates the button shortcode:

    function add_shortcode_button_function() {
    	/*I have tryed a bunch of things to create the button, but none have worked*/
    }
    add_shortcode( 'the_button_shortcode', 'add_shortcode_button_function' );

    I have created the function with the AJAXIZED div:

    function ajaxized_function() {
    	echo '<div id="ajaxize_this:reloaded_content_function:xxxxxx></div>';
    }

    I have created the function that loads inside the AJAXIZED div:

    function reloaded_content_function() {
    	echo 'The button has been clicked.';
    }

    THE QUESTION:
    So the question would be, what should be the button code?

    Thanks in adavnce!!!

    https://www.ads-software.com/plugins/ajaxize/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author yoav.aner

    (@yoavaner)

    Hi Enri,

    Unfortunately Ajaxize wasn’t designed for your use case. It was created to be able to dynamically load code using a static html tag, primarily when pages are cached.

    If you want to trigger a server function via a button click, then you’d need to handle it with javascript on the frontend anyway, and once you do that, there’s very little value in using Ajaxize in the first place.

    Unfortunately I can’t really help much. I suggest looking for other plugins or resources on how to use javascript to load dynamic content from wordpress.

    Yoav

    Thread Starter Enri

    (@enriqueerrando)

    Ok, thanks for the answer anyway, I appreciate u took the time ??

    See ya!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘BUTTON TO CALL A PHP AJAXIZED FUNCTION’ is closed to new replies.