[Widget]Realtime topic updates
-
You can get the data from any route by adding
/api
to the front of the route.$.getJSON('/api/category/1', function (data) { console.log(data.topics); });
Will return up to the 20 most recent topics. The same that the user would see if they were viewing the page for category 1.
-
@yariplus said:
$.getJSON('/api/category/1', function (data) {
console.log(data.topics);
});I think i got this as a response for the request: "/category/1/announcements"
Don't know if i am doing it wrong. I created a new html widget and added your script inside a script tag. In the console, I am not getting anything. But i can see the request is successful, but there is no console.log outputting. In the network tab, i can see the response for this request as : "/category/1/announcements"
Sorry for the bad english
Copyright © 2024 NodeBB | Contributors