main.js 853 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. function Proxy() {};
  2. Proxy.prototype.root = function(){
  3. return www + '/main/inc/ajax/course_description.ajax.php';
  4. }
  5. Proxy.prototype.post = function(data, f){
  6. if(typeof(sec_token)!=='undefined'){
  7. data.sec_token = sec_token;
  8. }
  9. $.post(this.root(), data, f, 'json');
  10. }
  11. var CourseDescription = new Proxy();
  12. CourseDescription.del = function(c_id, id, f)
  13. {
  14. var data = {
  15. c_id: c_id,
  16. id: id,
  17. action: 'delete'
  18. };
  19. this.post(data, f);
  20. };
  21. CourseDescription.delete_by_course = function(c_id, session_id, f)
  22. {
  23. var data = {
  24. c_id: c_id,
  25. session_id: session_id,
  26. action: 'delete_by_course'
  27. };
  28. this.post(data, f);
  29. };
  30. var message = {};
  31. message.update = function(data){
  32. text = typeof(data)=='string' ? data : data.message;
  33. $('#messages').html(text)
  34. }