我想我已经以某种方式打破了ajax ......但无法修复它

时间:2017-07-20 10:55:46

标签: php ajax centos plesk

我在Centos / Plesk VPS上使用ScriptCase。我一直有关于由于事务错误导致更新无效的错误消息,并将其跟踪到MySQL 5.5库中的错误,并遵循MySQL错误修复,然后允许yum update执行其操作。它已升级到MySql 5.6作为其中的一部分。它总共进行了大约430次更新。

从那时起,我的网页已经崩溃了。他们已经离开: working screen

到:

broken screen

看看ScriptCase生成的(大量)源代码,它在很大程度上依赖于Ajax - 所以我猜测Ajax并没有正常工作。

到目前为止,我找不到任何可能已经破坏或如何复活的建议。

我已经包含了页面代码的第一部分,但不包括整个代码,因为它很长。

如何解决此问题的帮助将不胜感激!



!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

<html DIR='LTR'>

<HEAD>
  <TITLE>DutyDoctor Rota System: Login </TITLE>
  <META http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <META http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT" />
  <META http-equiv="Last-Modified" content="Thu, 20 Jul 2017 10:21:02 GMT" />
  <META http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate" />
  <META http-equiv="Cache-Control" content="post-check=0, pre-check=0" />
  <META http-equiv="Pragma" content="no-cache" />
  <link rel="stylesheet" href="/_lib/prod/third/jquery_plugin/thickbox/thickbox.css" type="text/css" media="screen" />
  <SCRIPT type="text/javascript">
    var sc_pathToTB = '/_lib/prod/third/jquery_plugin/thickbox/';
    var sc_blockCol = 'scriptcase__NM__btn__NM__scriptcase8_DarkBlue__NM__tree_menos.png';
    var sc_blockExp = 'scriptcase__NM__btn__NM__scriptcase8_DarkBlue__NM__tree_mais.png';
    var sc_ajaxBg = '#6e6e6e';
    var sc_ajaxBordC = '#8DA0C8 ';
    var sc_ajaxBordS = 'solid';
    var sc_ajaxBordW = '1px';
    var sc_ajaxMsgTime = 2;
    var sc_img_status_ok = '/_lib/img/scriptcase__NM__iconsuccess.png';
    var sc_img_status_err = '/_lib/img/scriptcase__NM__iconfails.png';
    var sc_css_status = 'scFormInputError';
  </SCRIPT>
  <SCRIPT type="text/javascript" src="/_lib/prod/third/jquery/js/jquery.js"></SCRIPT>
  <SCRIPT type="text/javascript" src="/_lib/prod/third/jquery/js/jquery-ui.js"></SCRIPT>
  <link rel="stylesheet" href="/_lib/prod/third/jquery/css/smoothness/jquery-ui.css" type="text/css" media="screen" />
  <SCRIPT type="text/javascript" src="/_lib/lib/js/jquery.iframe-transport.js"></SCRIPT>
  <SCRIPT type="text/javascript" src="/_lib/lib/js/jquery.fileupload.js"></SCRIPT>
  <SCRIPT type="text/javascript" src="/_lib/prod/third/jquery_plugin/malsup-blockui/jquery.blockUI.js"></SCRIPT>
  <SCRIPT type="text/javascript" src="/_lib/prod/third/jquery_plugin/thickbox/thickbox-compressed.js"></SCRIPT>
  <style type="text/css">
    .fileinput-button-padding {
      padding: 3px 10px !important;
    }
    
    .fileinput-button {
      position: relative;
      overflow: hidden;
      float: left;
      margin-right: 4px;
    }
    
    .fileinput-button input {
      position: absolute;
      top: 0;
      right: 0;
      margin: 0;
      border: solid transparent;
      border-width: 0 0 100px 200px;
      opacity: 0;
      filter: alpha(opacity=0);
      -moz-transform: translate(-300px, 0) scale(4);
      direction: ltr;
      cursor: pointer;
    }
  </style>
  <SCRIPT type="text/javascript" src="/_lib/lib/js/jquery.scInput.js"></SCRIPT>
  <SCRIPT type="text/javascript" src="/_lib/lib/js/jquery.fieldSelection.js"></SCRIPT>
  <link rel="stylesheet" type="text/css" href="/_lib/css/Sc8_PictonBlue/Sc8_PictonBlue_form.css" />
  <link rel="stylesheet" type="text/css" href="/_lib/css/Sc8_PictonBlue/Sc8_PictonBlue_formLTR.css" />
  <link rel="stylesheet" type="text/css" href="/_lib/css/Sc8_PictonBlue/Sc8_PictonBlue_tab.css" />
  <link rel="stylesheet" type="text/css" href="/_lib/css/Sc8_PictonBlue/Sc8_PictonBlue_tabLTR.css" />
  <link rel="stylesheet" type="text/css" href="/_lib/buttons/scriptcase8_DarkBlue/scriptcase8_DarkBlue.css" />
  <link rel="stylesheet" type="text/css" href="/login/login_ltr.css" />

  <script>
    var scFocusFirstErrorField = false;
    var scFocusFirstErrorName = "";
  </script>


  <form name="form_ajax_redir_1" method="post" style="display: none">
    <input type="hidden" name="nmgp_parms">
    <input type="hidden" name="nmgp_outra_jan">
    <input type="hidden" name="script_case_session" value="aud3rabup6ud7kpmgr0l87inq7">
  </form>
  <form name="form_ajax_redir_2" method="post" style="display: none">
    <input type="hidden" name="nmgp_parms">
    <input type="hidden" name="nmgp_url_saida">
    <input type="hidden" name="script_case_init">
    <input type="hidden" name="script_case_session" value="aud3rabup6ud7kpmgr0l87inq7">
  </form>

  <SCRIPT>
    // remote scripting library
    // (c) copyright 2005 modernmethod, inc
    var sajax_debug_mode = false;
    var sajax_request_type = "POST";
    var sajax_target_id = "";
    var sajax_failure_redirect = "";

    function sajax_debug(text) {
      if (sajax_debug_mode)
        alert(text);
    }

    function sajax_init_object() {
      sajax_debug("sajax_init_object() called..")

      var A;

      if (window.XMLHttpRequest) {
        A = new XMLHttpRequest();
      } else {
        var msxmlhttp = new Array(
          'Msxml2.XMLHTTP.5.0',
          'Msxml2.XMLHTTP.4.0',
          'Msxml2.XMLHTTP.3.0',
          'Msxml2.XMLHTTP',
          'Microsoft.XMLHTTP');
        for (var i = 0; i < msxmlhttp.length; i++) {
          try {
            A = new ActiveXObject(msxmlhttp[i]);
          } catch (e) {
            A = null;
          }
        }

        if (!A && typeof XMLHttpRequest != "undefined")
          A = new XMLHttpRequest();
      }
      if (!A)
        sajax_debug("Could not create connection object.");
      return A;
    }

    var sajax_requests = new Array();

    function sajax_cancel() {
      for (var i = 0; i < sajax_requests.length; i++)
        sajax_requests[i].abort();
    }

    function sajax_do_call(func_name, args) {
      var i, x, n;
      var uri;
      var post_data;
      var target_id;
      var charset_html = document.inputEncoding.toLowerCase();
      var charset_esp = [
        "utf-8",
        "windows-1250",
        "windows-1253",
        "windows-1254",
        "windows-1255",
        "windows-1256",
        "windows-1257",
        "iso-8859-4",
        "iso-8859-6",
        "iso-8859-7",
        "iso-8859-8",
        "iso-8859-8-i",
        "iso-8859-9",
        "iso-8859-13",
        "euc-kr"
      ];

      sajax_debug("in sajax_do_call().." + sajax_request_type + "/" + sajax_target_id);
      target_id = sajax_target_id;
      if (typeof(sajax_request_type) == "undefined" || sajax_request_type == "")
        sajax_request_type = "GET";

      uri = "/login/";
      // NM
      if (-1 != uri.indexOf("?"))
        uri = uri.substr(0, uri.indexOf("?"));
      // NM
      if (sajax_request_type == "GET") {

        if (uri.indexOf("?") == -1)
          uri += "?rs=" + escape(func_name);
        else
          uri += "&rs=" + escape(func_name);
        uri += "&rst=" + escape(sajax_target_id);
        uri += "&rsrnd=" + new Date().getTime();

        for (i = 0; i < args.length - 1; i++)
          uri += "&rsargs[]=" + escape(args[i]);

        post_data = null;
      } else if (sajax_request_type == "POST") {
        post_data = "rs=" + escape(func_name);
        post_data += "&rst=" + escape(sajax_target_id);
        post_data += "&rsrnd=" + new Date().getTime();

        for (i = 0; i < args.length - 1; i++)
          post_data = post_data + "&rsargs[]=" + (-1 != $.inArray(charset_html, charset_esp) ? encodeURIComponent(args[i]) : escape(args[i]));
      } else {
        alert("Illegal request type: " + sajax_request_type);
      }

      x = sajax_init_object();
      if (x == null) {
        if (sajax_failure_redirect != "") {
          location.href = sajax_failure_redirect;
          return false;
        } else {
          sajax_debug("NULL sajax object for user agent:\n" + navigator.userAgent);
          return false;
        }
      } else {
        x.open(sajax_request_type, uri, true);
        // window.open(uri);

        sajax_requests[sajax_requests.length] = x;

        if (sajax_request_type == "POST") {
          x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
          x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        }
        //charset magia, acontece aqui
        //x.setCharacterEncoding( document.inputEncoding );
        x.onreadystatechange = function() {
          if (x.readyState != 4)
            return;

          sajax_debug("received " + x.responseText);

          var status;
          var data;
          var txt = x.responseText.replace(/^\s*|\s*$/g, "");
          status = txt.charAt(0);
          data = txt.substring(2);

          if (status == "") {
            // let's just assume this is a pre-response bailout and let it slide for now
          } else if (status == "-")
            alert("Error: " + data);
          else {
            if (target_id != "")
              document.getElementById(target_id).innerHTML = eval(data);
            else {
              try {
                var callback;
                var extra_data = false;
                if (typeof args[args.length - 1] == "object") {
                  callback = args[args.length - 1].callback;
                  extra_data = args[args.length - 1].extra_data;
                } else {
                  callback = args[args.length - 1];
                }
                callback(eval(data), extra_data);
              } catch (e) {
                sajax_debug("Caught error " + e + ": Could not eval " + data);

                if (document.getElementById("id_fatal_error") && data.lastIndexOf('Fatal error') > -1) {
                  sc_ret_error = "<table width=20%><tr><td>" + data + "</td></tr></table>";
                  document.getElementById("id_fatal_error").style.display = "";
                  document.getElementById("id_fatal_error").innerHTML = sc_ret_error;
                }

              }
            }
          }
        }
      }

      sajax_debug(func_name + " uri = " + uri + "/post = " + post_data);
      x.send(post_data);
      sajax_debug(func_name + " waiting..");
      delete x;
      return true;
    }



    // wrapper for ajax_login_validate_emailid

    function x_ajax_login_validate_emailid() {
      sajax_do_call("ajax_login_validate_emailid",
        x_ajax_login_validate_emailid.arguments);
    }



    // wrapper for ajax_login_validate_passwd

    function x_ajax_login_validate_passwd() {
      sajax_do_call("ajax_login_validate_passwd",
        x_ajax_login_validate_passwd.arguments);
    }
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

好的 - 我设法解决了这些问题。主要的问题是Apache没有运行,这是因为在升级过程中的某些时候我已经删除了PHP(我已经及时重新安装)和Plesk doesn't like this

plesk修复工具非常有助于解决大部分问题,但我还需要硬链接

$ ln -s /usr/bin/php-cgi /var/www/cgi-bin/cgi_wrapper/cgi_wrapper

也是为了解决其中的错误。