[ckan-discuss] Show Dataset Count Externally

Rufus Pollock rufus.pollock at okfn.org
Wed Nov 28 11:59:14 GMT 2012


Simple fix: just replace thedatahub.org with datahub.io.

Problem is that turns out that jquery ajax calls do not follow redirects!

Rufus

On 28 November 2012 11:00, Sam Smith <sam.smith at okfn.org> wrote:
> ..apparently this was previously being achieved with the following JS, but
> is now not working:
>
> jQuery(document).ready(function($) {
> var group = 'economics';
> var url = 'http://thedatahub.org/api/search/dataset?groups=' + group;
> $.getJSON(url, function(data) {
> // class selector for the page element where info should be inserted
> $('.ckanjs-widget-count').html(data.count);
> });
> });
>
>
> On 28 November 2012 10:37, Sam Smith <sam.smith at okfn.org> wrote:
>>
>> I need to get the number of datasets in a group
>> (http://datahub.io/group/economics) and display this number on a webpage. Is
>> this possible? How so?
>>
>> --
>> Sam Smith
>> Designer
>>
>
>
>
> --
> Sam Smith
> Designer
>
>
> _______________________________________________
> ckan-discuss mailing list
> ckan-discuss at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-discuss
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-discuss
>



-- 
Co-Founder, Open Knowledge Foundation
Promoting Open Knowledge in a Digital Age
http://www.okfn.org/ - http://blog.okfn.org/



More information about the ckan-discuss mailing list