cotonti.com : Ajax URLs - Need help understanding them. https://www.cotonti.com Последние сообщения в теме Cotonti en Wed, 26 Nov 2025 16:41:44 -0000 lukgoh Thank you for your help Macik. 

]]>
пт, 15 ноя 2013 11:00:23 -0000
Macik All Cotinti Ajax helper functions is coded for user actions like click for «ajaxed» link or «ajaxed» form submit.

So better way to implement your function is to write own JS code and bind it to select change event. Something like that (should works only with jQuery and Ajax setting enables in Admin panel):

$('#mySelect').change(function() { 
    ajaxEnabled && ajaxSend({
            method: 'GET',
            url: 'url/to/your/app',
            divId: 'targetBlockID'
        });
});

Or something like this in native JS — should work (but not tested) without jQuery and Ajax enabled settings.

var mySelect = document.getElementById('mySelectBoxId');
mySelect.onchange = function() {
  var xhr = new XMLHttpRequest(); 
    xhr.open('GET', '/url/of/your/app', true); 
    xhr.onreadystatechange = function() {  
      if (xhr.readyState != 4) return; 
      outputElem.innerHTML = xhr.responseText; 
    }
    xhr.send(null); 
}

[By the way - this native code is not actually crossbrowser.]

]]>
ср, 13 ноя 2013 22:53:31 -0000
lukgoh Hello, I'm looking for more information on better understanding how to render ajax urls from Cotonti's core functionality. 

I understand cot_pagenav() works really well on creating ajax friendly page navigation, but I am struggling to understand how (if possible) to achieve a similar ajax friendly url using cot_url(). I understand for ajax to work you need to include class="ajax" and have a rel=" -- ajax or hash url here --" but I am struggling to clearly understand hot to achieve this. 

 I am currently trying to use a dropdown select box to refresh the plugin (and only the plugin, instead of the whole page) like found in the user list part of the frame work, except without refreshing the enitre page.

Luke.

]]>
ср, 13 ноя 2013 17:30:13 -0000