Index: trunk/extensions/MarkAsHelpful/modules/ext.markAsHelpful/ext.markAsHelpful.js |
— | — | @@ -44,9 +44,11 @@ |
45 | 45 | 'format': 'json' |
46 | 46 | |
47 | 47 | }; |
48 | | - |
49 | | - $.post( mw.util.wikiScript('api'), request, |
50 | | - function( data ) { |
| 48 | + $.ajax({ |
| 49 | + type: 'get', |
| 50 | + url: mw.util.wikiScript('api'), |
| 51 | + data: request, |
| 52 | + success: function( data ) { |
51 | 53 | if ( data && data.query && data.query.mahitem && |
52 | 54 | data.query.mahitem.length > 0 |
53 | 55 | ) { |
— | — | @@ -56,11 +58,13 @@ |
57 | 59 | // Failure, remove the item for now. |
58 | 60 | $item.find( '.mw-mah-wrapper' ).remove(); |
59 | 61 | } |
60 | | - }, 'json' ) |
61 | | - .error( function() { |
62 | | - // Error, remove the item for now. |
| 62 | + }, |
| 63 | + error: function ( data ) { |
| 64 | + // Failure, remove the item for now. |
63 | 65 | $item.find( '.mw-mah-wrapper' ).remove(); |
64 | | - } ); |
| 66 | + }, |
| 67 | + dataType: 'json' |
| 68 | + }); |
65 | 69 | }, |
66 | 70 | /* |
67 | 71 | * API call to mark or unmark an item as helpful. |