This is the main calling page. I assume I need to include the jquery
library and flot library on this page as well? Its currently making
the call to the page(seen in firebug) but does not display anything.
24hr is the jquery/flot page. Im a bit confused what I need to wrap
the function around.
<script type="text/javascript"
src="../js/jquery-1.3.2.js"></script>
<script type="text/javascript"
src="../js/flot/jquery.flot.js"></
script>
<script src="../js/mootools-1.2.4-core-jm.js" type="text/
javascript"></script>
<script type="text/javascript">
window.addEvent('domready', function(){
var $ = document.id;
var result = $('result');
var req = new Request.HTML({
method: 'get',
evalScripts: false, /* this is the default */
evalResponse:false,
onSuccess: function(responseTree,
responseElements,responseHTML, responseJavaScript){
result.set('html',responseHTML);
$exec(responseJavaScript);
},
onFailure: function() {result.set('text', 'The
request
failed.');},
onComplete: function() {console.log('ajax
complete!')}
});
$('makeRequest').addEvent('click', function(e){
e.preventDefault();
req.send({url: $('makeRequest').get('href')});
this.removeEvent('click');
});
$('24hr').addEvent('click', function(e){
e.preventDefault();
req.send({url: $('24hr').get('href')});
this.removeEvent('click');
});
});
</script>
On Feb 10, 4:59 pm, Fábio M. Costa <[email protected]> wrote:
> The mootools $ function might be the current $ dollar function, so your
> chart plugin thinks that $ is the jQuery function/object, and it wont work.
>
> You dont need noConflict anymore.
>
> You can include jQuery before mootools and use document.id() instead of $()
> for the mootools scripts.
> $ will be the jQuery object.
>
> If your mootools script uses the $ function in too much places you can still
> create a closure around your mootools code and mirror document.id to be the
> dollar function like this:
>
> (function($){
>
> // your moootools code using $ as the normal $ function
>
> })(document.id);
>
> --
> Fábio Miranda Costa
> Solucione Sistemas
> Engenheiro de interfaces
>
> On Wed, Feb 10, 2010 at 7:38 PM, Dial <[email protected]> wrote:
> > This worked out great. Now Im kicking it up a notch. I have a page
> > that uses FLOT ( jQuery chart library ). I converted that page to use
> > the jQuery.noConflict();. When I call the page everything works
> > except the graph does not plot.
>
> > Any ideas?
>
> > On Feb 8, 11:21 am, Fábio M. Costa <[email protected]> wrote:
> > > 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>
>
>