[support] adding an Onclick setting to jquery drupal settings

Idan Arbel idan at arbel-designs.com
Sun Dec 27 08:25:40 UTC 2009


Hi,

Thanks for the tip, I'm actually able to get only the section I need, the
problem is that the js tabs in that page aren't appearing.

I'm following this guide:
http://www.erikhedin.com/web-design/drupal-tips/Easy-Ajax-Nodes-Lightbox-Con
tent#comment-37  using lightbox2.

this is the code i'm using:
<a href="/websites/shooky/node/130/lightbox2"  class="ajaxme">test ajax</a>
          <script type="text/javascript">
$(document).ready(function(){
 	$("a.ajaxme").click(function(){

	var AjaxSRC = $(this).attr("href");
	//grabs the href location of the click link;
	
	$("#ajaxtarget").empty().load(AjaxSRC + " #ajaxme");
	//empties the div and loads in the content;
	$("#ajaxtarget").ready(Drupal.attachBehaviors);
	return false;
	//stops the link action form changing the page
	
	});

});
</script>          <div id="ajaxtarget"></div>

the section of the page loads, but the tabs and tab content is missing.

i'd appreciate any help. Thanks.
-----Original Message-----
From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On
Behalf Of Jamie Holly
Sent: Sunday, December 27, 2009 12:07 AM
To: support at drupal.org
Subject: Re: [support] adding an Onclick setting to jquery drupal settings

If you are doing JQuery.load you can put a selector in the URL. That way 
it will only return the part of the page you want. See this page for 
details:

http://docs.jquery.com/Ajax/load

Jamie Holly
http://www.intoxination.net
http://www.hollyit.net


On 12/26/2009 3:40 PM, Idan Arbel wrote:
> Hi,
>
> Thank you for your assistance, you've been a very helpful and patient and
I
> appreciate it.
> I'll keep on working on my issue of the tabs that aren't appearing.
>
> Once, again thanks for your time and for the help. I really appreciate it.
>
> Idan
>
> -----Original Message-----
> From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On
> Behalf Of Fred Jones
> Sent: Saturday, December 26, 2009 10:34 PM
> To: support at drupal.org
> Subject: Re: [support] adding an Onclick setting to jquery drupal settings
>
> >  I found a tutorial here:
>
http://www.erikhedin.com/web-design/drupal-tips/Easy-Ajax-Nodes-Lightbox-Con
> tent
> >
> >  On how to do it with lightbox2. But still with the same result, and
this
> time just the content part and NOT the entire page.
>
> That's fantastic! The code is working perfectly then. Because that's
> *exactly* what that tutorial wants to achieve--to load just the
> content of a node via Ajax.
>
> People here will be happy to provide support with Drupal questions,
> but I will repeat what I said before--you need to learn how jQuery
> works. That or find a programmer who understands it. This list,
> however, is not the place to learn jQuery.
>
> Fred
>    
-- 
[ Drupal support list | http://lists.drupal.org/ ]



More information about the support mailing list