I’m starting to learn MooTools and so far I found it really hard how to make a code similir to the jQuery version
<span id="clickme" onclick="myFunction(5,46,'add')"/> I'm a span</span>
function myFunction(id,iduser,type){
// ajax request with this values
}
In MooTools
window.addEvent('domready', function() {
$('clickme').addEvent('click', function()
{
// ajax request ...
});
}
er. what? you already have done the click handler, so why not call your function?
this can work with say
<span id='clickme' data-a='5' data-b='45'>click me</span>just read the docs and read some tutorials – plenty of examples comparing ajax in many frameworks. this got posted on twitter today: http://wernancheta.wordpress.com/2012/08/03/performing-ajax-calls-on-jquery-dojo-and-mootools/ – not saying it’s goot or whatever but its there.
http://mootools.net/docs/core/Request/Request
http://mootools.net/docs/core/Element/Element.Event#Element:addEvent