Some time ago I investigated saving user preferences to wikipages. I believe that I found out that this was not possible using the XMLHTTPRequest object, but I'll look into it again.
It will work using an iframe loading a page in edit mode. The javascript inside the iframe edit-mode page can then automatically change the editbox and save the form.