your not calling the method send. use send();
Still you shouldnt be creating a request per each click of the mouse. look here, if it doenst work, just tell us. http://mootools.net/shell/r44fJ/ -- Fábio Miranda Costa Solucione Sistemas Engenheiro de interfaces On Mon, Feb 8, 2010 at 3:00 PM, Dial <[email protected]> wrote: > I am currently having issues with ajax and populating a div. I have > some pages that have ajax calls in them to create charts or pull data > from a database to create the page. I want to have one page that use > click/href events to populate a div on the main page. > > Now here is my problem. The javascript that is on these other pages > does not fire to populate the pages, but the static html does come > back from the request. Ive tried to do this a couple different. I > have seen this work when requesting a static page, but just not a > dynamic one. Any help would be great. > > <script src="../js/mootools-1.2.4-core-jm.js" type="text/ > javascript"></script> > <script type="text/javascript"> > > window.addEvent('domready', function(){ > $('makeRequest').addEvent('click', > function(e){ > e.stop(); > var req = new Request.HTML({ > //url: ' > http://167.76.44.21:8080/maint/spwhodo.html', > url: > $('result').get('href'), > method: 'get', > evalScripts: false, /* this > is the default */ > evalResponse:false, > onSuccess: > function(responseTree, responseElements, > responseHTML, responseJavaScript) > { > alert(responseJavaScript); > > $('result').set('html',''); > > $('result').set('html',responseHTML); > > $exec(responseJavaScript); > }, > onFailure: function() > {$('result').set('text', 'The request > failed.');}, > onComplete: function() > {console.log('ajax complete!')} > }).send; > > $('makeRequest').removeEvent('click'); > }); > }); > </script> >
