I can’t promise that I know what I’m doing but I might be able to take a look at it.
I just got some ajax to work in 1.2 – I’ll take a look. Where can I get the code you’re working on?
Thanks, guys.
I zipped up my latest code here:
http://erwingerrits.com/bp-events.zip
It installs and loads without errors, but the AJAX never gets loaded. BuddyPress just loads AJAX.php and global.js, automatically handling all Groups scripts, so I have to copy the relevant code into a seperate ajax & global file and load it.
It won’t even attempt to load the javascript files for the widget… it creates the widget, but the enqueue_script won’t add the javascript to the header, even though I have checked the URL about a zillion times…
if ( is_active_widget( false, false, $this->id_base ) )
wp_enqueue_script( 'events_widget_events_list-js', WP_PLUGIN_URL .
'/bp-events/js/widget-events.js', array('jquery', 'jquery-livequery-pack') );
This seems to be OK.
I got a “jQuery(“div#events-list-options a”).livequery is not a function” error when loading the events widget javascript, which is exactly the same as groups widget js and loaded at the same time (from the widget constructor).
What does this error mean?
hi Erwin
It seems bp-default theme is no more using livequery.
If you are trying to load something after activity has loaded(using ajax), then I have also the same problem.
I had opened this ticket and waiting for an official response from Andy or JJJ
https://trac.buddypress.org/ticket/1616
just replace .livequery() with .live() since this is now built into jQuery.
Thanks Andy for the info.
Yes, live() works as a perfect replacement for livequery().
Any thought about how do we detect when activity is loaded, or anyway we can call our custom javascript functions after activity is loaded using ajax.
Thanks Andy!
Does this mean we no longer need ‘jquery-livequery-pack’ in the enqueue script?
And As Brajesh, I too am having trouble trying to figure out WHEN to load custom javascripts…