Needlworks / Textcube

Textcube : Brand yourself! / Personalized web publishing platform with multi-user support
http://www.textcube.org
Other
207 stars 55 forks source link

Get rid of bloated Javascripts for AJAX forms #1646

Open achimnol opened 10 years ago

achimnol commented 10 years ago

We no longer need to use customized Javascript to read values from HTML forms and compile them into as a POST parameter manually. Let the browser do the trick and we may just intercept the POST handler to implement AJAX UI updates. The current implementation uses a lot of redundant codes with mixed/missing/mis-typed field names and confusing IDs of input elements, thus fallback for Javascript-disabled environments would not work and the codes are bug-prone.

The expected amount of modification is large enough to rewrite most of interface PHP files under the interface/owner directory.

inureyes commented 9 years ago

:+1:

achimnol commented 9 years ago

Applied to addComment() in resources/script/common2.js for demonstration of jQuery-way of AJAX calls (at 818f154). We need further work: