Support » Plugin: Ajaxize » Example of load function on click

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

    (@yoavaner)

    The example you linked to seems like a working example. You say that you’re not good with coding, yet you’re trying to do something quite advanced, that typically requires some coding experience.

    If you find someone with some coding experience, I’m sure they can help you implement something, and most likely you won’t even need Ajaxize.

    Ajaxize is meant to be used by people with limited coding experience, but only for the more common use-case of converting a PHP function into an ajax call. Anything beyond that, I don’t think Ajaxize helps so much with.

    all i need is the “load function on click” part.. dont mind the download part.

    so from the link, ill just add the code to ajaxise_this.js right?
    and for my theme, how do i use it on the button or link? can you please give me a simple example?

    Can you please tell me how to use this?
    http://pastebin.com/FMPdZ8yR

    this is my code.. i cant get it to work. im still new to javascript. 🙁

    <button id="ajaxize_this:DownloadButtons:b2c0d38788b92b6b243acd34d2066c3xxxx">Load Content</button>
    
    <div id="ajaxize_this:DownloadButtons"></div>
    
    <script>
    /* ajaxize javascript function - calls ajaxize_this on the server for the div */
    jQuery(document).ready( function($) {
        $("#ajaxize_this:DownloadButtons:b2c0d38788b92b6b243acd34d2066c3xxxx").click(function() {
            $('div[id^="ajaxize_this"]').each( function() {
                    var newquery = $.query.set('ajaxize_this', $(this).attr('id')).set('_wpnonce', ajaxizeParams._wpnonce);
    
                    $(this).load(location.pathname + newquery, function() {
                            // renaming div id to prevent loops
                            $(this).attr('id', 'loaded_' + $(this).attr('id'));
                    });
            });
            return false;
        });
    });
    </script>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Example of load function on click’ is closed to new replies.