这是一项艰巨的任务,你肯定需要获得 j。 然而,这只是一个开端。 你们应该使用一个javascript框架,像你们大多数项目一样,因为这个框架使一切 j都更加容易,使浏览器的兼容性成为天花。
然后,你想要下载/下载Dajax(www.dajaxproject.com)。 这使你能够把你的看法登记在“达哈克斯”方法上,这使你能够把他们从该页上的 j印上。
You would have the buttons in HTML on the page. For the onchange property, you would call a javascript method, passing it the current value (this.value). That javascript method would call a dajax method sending it a return callback method. The callback method is a javascript function that will be called when the Dajax method is done. If you want the callback method to do something and have any parameters, you would return a simplejson.dumps() to the callback method from your Dajax view. In your case, you would probably not need to pass anything back to the callback method, since you are simply saving the change to the database.