/js/libs/api.php
PHP | 21 lines | 17 code | 3 blank | 1 comment | 0 complexity | eecbd50fe05008238acadcf6dd1b4114 MD5 | raw file
- define([],function() {
- return {
- Router: Backbone.Router.extend({
- routes: {
- "watchlist": "watchlist"
- },
- watchlist: function () {
- $.get("http://en.wikipedia.org/w/api.php",{action:"query",list:"watchlist",wllimit:150,format:"json",wlprop:"title|ids|user|comment|flags"},function(data) {
- $.each(data.query.watchlist, function(x,item) { $("#content").append(item.title);$("#container").append("<br />"); });
- });
- },
- defaultAction: function(actions){
- // We have no matching route, lets just log what the URL was
- console.log('No route:', actions);
- }
- })
- };
- });