【问题标题】:Is this script only written in javascript and html?这个脚本是否只用 javascript 和 html 编写?
【发布时间】:2017-08-23 00:38:54
【问题描述】:

我不拥有这个脚本,但我很想知道它是否用除了 javascript 和 html 之外的任何东西编写。

有什么地方可以写这样的脚本吗?如果是这样,你能推荐任何网站吗?非常感谢。

<script>
  function login() {
    var username = $('#loginusername').val();
    var password = $('#loginpassword').val();
    document.getElementById("logindiv").style.display = "none";
    document.getElementById("loginimage").style.display = "inline";
    var xmlhttp;
    if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp = new XMLHttpRequest();
    } else { // code for IE6, IE5
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange = function() {
      if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
        document.getElementById("logindiv").innerHTML = xmlhttp.responseText;
        document.getElementById("loginimage").style.display = "none";
        document.getElementById("logindiv").style.display = "inline";
        if (xmlhttp.responseText.search("Redirecting") != -1) {
          setInterval(function() {
            window.location = "index.php"
          }, 3000);
        }
      }
    }
    xmlhttp.open("POST", "ajax/login.php?type=login", true);
    xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlhttp.send("username=" + username + "&password=" + password);
  }
</script>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Chither.com The best Slither and Agar.io bots service</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="icon" type="image/png" href="/favicon.png" />
  <meta name="Description" content="free bots, best experience, without lags, Slither.io bots - Best Bots for Slither, agar.io bots - Best Bots for agar.io" />
  <meta name="Author" content="" />
  <meta name="Reply-To" content="" />
  <meta name="Robots" content="all" />
  <meta name="Rating" content="general" />
  <meta name="Keywords" content="Slither.io, chither, Slither bot, Slitherbots, Slither bots, Slitherio bots, Chither.com, hacks, cheats, free, bots, Slitheriobots, Slitherio bots, Slither.io bots, Bot, Worms, Worm, Bots, Worms, support, best, lagfree, Slither, agar.io, agar bot, agarbots, agar bots, agario bots, hacks, cheats, free, bots, agariobots, agario bots, agar.io bots, Bot, Minion, Bots, Minions, support, best, lagfree, agar, mass bot"
  />
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="font-awesome/css/font-awesome.css" rel="stylesheet">
  <!-- Toastr style -->
  <link href="css/plugins/toastr/toastr.min.css" rel="stylesheet">
  <!-- Gritter -->
  <link href="js/plugins/gritter/jquery.gritter.css" rel="stylesheet">
  <link href="css/animate.css" rel="stylesheet">
  <link href="css/style.css" rel="stylesheet">
  <!-- Mainly scripts -->
  <script src="js/jquery-2.1.1.js"></script>
  <script src="js/bootstrap.min.js"></script>
  <script type="text/javascript" src="js/plugins/jquery-validation/jquery.validate.min.js"></script>
  <script type="text/javascript" src="js/plugins/mcustomscrollbar/jquery.mCustomScrollbar.min.js"></script>
  <script type="text/javascript" src="js/plugins.js"></script>
  <script type="text/javascript" src="js/demo.js"></script>
  <script type="text/javascript" src="js/actions.js"></script>

  <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
  <script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
  <!-- Flot -->
  <script src="js/plugins/flot/jquery.flot.js"></script>
  <script src="js/plugins/flot/jquery.flot.tooltip.min.js"></script>
  <script src="js/plugins/flot/jquery.flot.spline.js"></script>
  <script src="js/plugins/flot/jquery.flot.resize.js"></script>
  <script src="js/plugins/flot/jquery.flot.pie.js"></script>
  <!-- Peity -->
  <script src="js/plugins/peity/jquery.peity.min.js"></script>
  <script src="js/demo/peity-demo.js"></script>
  <!-- Custom and plugin javascript -->
  <script src="js/inspinia.js"></script>
  <script src="js/plugins/pace/pace.min.js"></script>
  <!-- jQuery UI -->
  <script src="js/plugins/jquery-ui/jquery-ui.min.js"></script>
  <!-- GITTER -->
  <script src="js/plugins/gritter/jquery.gritter.min.js"></script>
  <!-- Sparkline -->
  <script src="js/plugins/sparkline/jquery.sparkline.min.js"></script>
  <!-- Sparkline demo data  -->
  <script src="js/demo/sparkline-demo.js"></script>
  <!-- ChartJS-->
  <script src="js/plugins/chartJs/Chart.min.js"></script>

  <script>
    (function(i, s, o, g, r, a, m) {
      i['GoogleAnalyticsObject'] = r;
      i[r] = i[r] || function() {
        (i[r].q = i[r].q || []).push(arguments)
      }, i[r].l = 1 * new Date();
      a = s.createElement(o),
        m = s.getElementsByTagName(o)[0];
      a.async = 1;
      a.src = g;
      m.parentNode.insertBefore(a, m)
    })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');

    ga('create', 'UA-77344643-1', 'auto');
    ga('send', 'pageview');
  </script>
  <script type="text/javascript">
    window.cookieconsent_options = {
      "message": "This website uses cookies to ensure you get the best experience on our website",
      "dismiss": "Got it!",
      "learnMore": "More info",
      "link": "",
      "theme": "dark-bottom"
    };
  </script>
  <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/1.0.10/cookieconsent.min.js"></script>
  <!-- Toastr -->
  <!--<script src="js/plugins/toastr/toastr.min.js"></script>-->
</head>

<body class="gray-bg">
  <!--<body style="background-image: url(http://slither.io/s/bg45.jpg); background-repeat: repeat;">-->
  <div class="middle-box text-center loginscreen animated fadeInDown">
    <div>
      <div>

        <!--<h1 class="logo-name">CHITHER.COM</h1>-->
        <img src="logo.png" />

      </div>
      <!--<h3>Welcome to Chither.com</h3>-->
      <p>Login in</p>
      <div class="m-t">
        <div id="logindiv" style="display:none"></div>
        <img id="loginimage" src="img/ajax-loader.gif" style="display:none" />
        <div class="form-group">
          <input type="text" name="username" id="loginusername" class="form-control" placeholder="Username" value="" />
        </div>
        <div class="form-group">
          <input type="password" name="password" id="loginpassword" class="form-control" placeholder="Password" value="" />
        </div>
        <div class="pull-left">
          <a href="http://chither.com/tos.php">By logging in, you agree to our ToS</a>
        </div>
        <br /><br />
        <button class="btn btn-primary block full-width m-b" type="button" onclick="login()">Sign in</button>

        <!--<a href="#"><small>Forgot password?</small></a>-->
        <p class="text-muted text-center"><small>Do not have an account?</small></p>
        <button class="btn btn-sm btn-white btn-block" onClick="location.href='register.php'">Create an account</button>
      </div>
      <p class="m-t"> <small>© All Rights Reserved Chither.com 2017</small> </p>
    </div>
  </div>
  <!-- Mainly scripts -->
  <script type="text/javascript">
    $("#signinForm").validate({
      rules: {
        login: "required",
        password: "required"
      },
      messages: {
        firstname: "Please enter your login",
        lastname: "Please enter your password"
      }
    });
  </script>
</body>

</html>

【问题讨论】:

  • 写这些的地方?那是一个……文本编辑器。还是我误会了?
  • 是的。它还使用了一个名为 jQuery 的 javascript 库和大量插件,但归根结底,它们都只是 javascript。它还包括一些 CSS 文件。 (正如 c0dekid 指出的那样,由于它使用 Ajax 并引用 php 文件,因此也发生了一些服务器端的事情。)
  • JavaScript,一些核心 JavaScript 和带有 ajax 请求的 javascript
  • 如果您的意思是在 ajax 中调用的脚本?然后是的,他们使用 PHP 来处理 ajax 请求。

标签: javascript html


【解决方案1】:

是的,这个“脚本”仅用 HTML 和 Javascript 编写,但它使用多个插件和框架。这是由链接 href 和 script 标签定义的。例如,bootstrap 是一个前端(您的页面看起来如何)框架,而 Jquery 是一个 Javascript 框架。

它确实引用了其他文件,例如 PHP(例如 index.php)和 CSS 样式(例如在链接 href="css/style.css" rel="stylesheet" 中)。如果没有这些 CSS 文件,您的网站将不会具有相同的外观和功能。

编写 HTML 最简单的方法是在记事本中并将它们保存为 .html。然后,您可以使用您喜欢的浏览器打开它们。对于入门教程,我会推荐 W3Schools。比如一个关于Js的教程是:https://www.w3schools.com/js/或者html:https://www.w3schools.com/html/

【讨论】:

    猜你喜欢
    • 2011-05-11
    • 1970-01-01
    • 2011-07-13
    • 1970-01-01
    • 2011-06-27
    • 2015-10-21
    • 2016-04-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多