Widget:EditSandbox: Difference between revisions

Jump to navigation Jump to search
Matt Pijoan (talk | contribs)
No edit summary
Matt Pijoan (talk | contribs)
No edit summary
Line 22: Line 22:
  }, {
  }, {
ok: function (data) {
ok: function (data) {
$.each(data.query.pages, function(index, value){
$.each(data.query.pages, function(index, value){
alert(value.edittoken);
  var token = value.edittoken;
  var api2 = new mw.Api();
  api2.get( {
      action: 'edit',
      format: 'json',
      title: 'GroundZero',
      section: 'new',
      summary: 'Testing',
      text: 'This is some new text',
      token: token,
  }, {
  ok: function(data2){
      alert("Edit'd!");
  }
});
})}});
})}});
}
}

Revision as of 18:14, 26 November 2012