Forum:How to edit a page via jQuery $.ajax()?

Greetings and Good day! I hit a brick wall, and hope I can ask this unless such things are not allowed to begin with.

How do i edit a page via Ajax request? Here is a sample code of what 'I think' is what I'm doing right based on ghelo.wikia.com/api.php:

//** gets an edit token var ve = apiRequest('api.php?format=json&action=query&titles=Test&prop=info&intoken=edit').query.pages; //** filters the right editToken and the timeStamp for(var xa in ve)if(ve[xa].title=='Test'){ var ne = { token:ve[xa].edittoken,time:ve[xa].starttimestamp}; break; } //** remove necessary chars from timestamp ne.time = (+ne.time).replace(/\-/g,).replace(/\:/g,).replace(/\T/g,).replace(/\Z/g,'');

//** here goes nothing $.ajax({ type:'POST',async:false,url:'http://ghelo.wikia.com/api.php?action=edit&title=Test&summary=YES&basetimestamp='+ne.time+'&text=OnlyThisIShouldSee&token='+ne.token+'',success:function(done,a,b){

gheloBox( printProperties(b) ); // some functions? gheloBox( a );                 // String 'success' gheloBox( done );              // returns the '/api.php' page?

},error:function{

gheloBox("T^T"); // not happening

}}); ^ Note: gheloBox outputs a sort-of dialog box.

Now, no matter how I modify the URL and refreshing the Test page, the content is still the same. I'd understand that this may not be allowed due to possible vandalism and abuse, and if so, is there a way (or request a way) to get around it?

Hope to get an immediate response, this is such a big wall in the development of our wiki... T^T

Thank you in advance - ^^ Fe2+ | talk 17:15, December 19, 2011 (UTC)


 * I am completely not into Ajax and cannot answer that part.


 * But have you tried to purge the page using the same url while editing but instead of &action=edit you use &action=purge ?




 * Do you mean, In checking if the page was edited or not? Yup, I tried, i typed the url:  in the address bar.  Hmm, or do you mean I should include this in the above code? - ^^ Fe2+ | talk 03:23, December 20, 2011 (UTC)