The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
PostPosted: Tue Dec 09, 2008 2:41 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Apr 02, 2007 11:19 am
Posts: 30
Hi,
Joomla! 1.5.7
I am a bit lost with MooTools since I have worked mainly with jQuery. If I load jQuery (with JDOC) I get this error:
js error:el.set is not a function on mootools.js line 23 - and Accordion Menu (mootools) does not work anymore.

I feel that I will have to ditch jQuery for MooTools but that is sad. I want to work with Joomla but I am only confident with jQuery. Anyway - is there a way to do this in MooTools?
- Get the "rel" value of the link and send it to an external page. Fill the result in div "detail". This is jQuery working:

Code:
$(document).ready(function() {
$(".detail").click(function(){
  var did = $(this).attr("rel");
  $.post("/code/getDetails.php", {id:did}, function(data){
       $("#detail").html(data);
   });
    });
});

HTML:
<div id="detail"</div>
<a href="#" rel="123">Product link</a>
<a href="#" rel="678">Product link</a>
<a href="#" rel="256">Product link</a>

Glad for any ideas!
/asle


Top
 Profile  
 
PostPosted: Tue Dec 09, 2008 3:49 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Tue Jun 13, 2006 12:20 pm
Posts: 465
if you want to use mootools and jquery together you need to use jquerys no conflict mode.

Before you run your code and just after you include the jquery.js do this

$j = jQuery.noConflict();

then replace all the $ with $j in your jquery code and you should be good.

Hth

Rob


Top
 Profile  
 
PostPosted: Wed Dec 10, 2008 10:19 am 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Wed Aug 17, 2005 10:32 pm
Posts: 342
Location: la Rochelle - France
Code:
var myAjax = new Ajax('/code/getDetails.php',
         {
            'data':{
            'id':did
            },
            'onComplete':function(data){
               $("detail").setHTML(data);
            }
         });

document.addEvent('domready', function(){
   document.getElements(".detail").addEvent(function(e){
      var event = new Event(e);
      event.stop();
      var did = $(event.target).rel;
      myAjax.options.data.id = did;
      myAjax.request();
   });
});

_________________
aka


Top
 Profile  
 
PostPosted: Sat Dec 13, 2008 3:12 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Apr 02, 2007 11:19 am
Posts: 30
Thanks Rob for your suggestion.
I get an error: ".. did is not defined" on
var myAjax = new Ajax('/code/getDetails.php',
{
'data':{
'id':did{

So I tried to put everything inside
document.addEvent('domready', function(){
- Still nothing happens. No errors and nothing in FireBug.
/asle


Top
 Profile  
 
PostPosted: Mon Dec 15, 2008 4:27 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Wed Aug 17, 2005 10:32 pm
Posts: 342
Location: la Rochelle - France
perhaps replace

'data':{
'id':did
}

with

'data':{}

_________________
aka


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 



Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group