Widget:Granularity: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
$('#go').click(function(){ | |||
if(wgAction === "view"){ | if(wgAction === "view"){ | ||
console.log(wgCategories[0]); | console.log(wgCategories[0]); | ||
} | } | ||
var api = new mw.Api(); | |||
api.get( { | api.get( { | ||
action: ' | action: 'query', | ||
prop: 'categories', | |||
titles: wgTitle, | |||
} ).done ( function ( data ) { | } ).done ( function ( data ) { | ||
console.log( data ); | console.log( data ); | ||
} ); | } ); | ||
}); | }); | ||
}); | |||
</script> | </script> | ||
<input type="button" value="Push!" id="go" /> | |||
</includeonly> | </includeonly> |