Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. function submitForm(){
  2. var lang = "java";
  3. $("[name='lang']").val("java");
  4. $("[name='code']").val(editors['code'].getValue());
  5. if( supportcode ){
  6. $("[name='support']").val(editors['supportcode'].getValue());
  7. }
  8. if( utilcode ){
  9. $("[name='util']").val(editors['utilcode'].getValue());
  10. }
  11. if( extracode ){
  12. $("[name='extra']").val(editors['extracode'].getValue());
  13. }
  14. if( inputs ){
  15. $("[name='inputs']").val(editors['inputs'].getValue());
  16. }
  17. $("[name='script']").val("compile_new");
  18. jQuery.support.cors = true;
  19. $('#wait').show();
  20. if ($.browser.webkit || $.browser.mozilla) {
  21. var url = "http://www.compileonline.com/compile_new.php";
  22. }else{
  23. var url = "col_proxy.php";
  24. }
  25. if( lang == "swift" ){
  26. url = "http://208.52.191.109/execute_new.php";
  27. }
  28. if( lang == "java8" ){
  29. url = "http://208.52.191.109/compile_new.php";
  30. }
  31. $.ajax({
  32. type: "POST",
  33. cache: false,
  34. crossDomain: true,
  35. url: url,
  36. target: "view",
  37. data: $("#ff").serialize(),
  38. success:function(data)
  39. {
  40. $('#view').contents().find("html").html(data);
  41. $('#wait').hide();
  42. return false;
  43. },
  44. error:function (data, status, error) {
  45. alert(error);
  46. return false;
  47. }
  48. });
  49. return false; // avoid to execute the actual submit of the form.
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement