如何仅使用javascript建立网站

JavaScript is one of the versatile language in the world. It allow us developers to build websites, servers, mobile apps, hardware and even AI. So it’s not a surprise that it’s one of the most popular programming languages in the world.

JavaScript是世界上通用的语言之一。 它使我们开发人员可以构建网站,服务器,移动应用程序,硬件甚至AI。 因此,它是世界上最受欢迎的编程语言之一,这不足为奇。

In this article, we’ll discuss what HTTP is, and learn JavaScript by building an HTTP server, rather than by learning HTML and CSS first. The image above is an example of what we’ll be build.

在本文中,我们将讨论什么是HTTP,并通过构建HTTP服务器而不是首先学习HTML和CSS来学习JavaScript。 上图是我们将要构建的示例。

Please note: The breaking bad part is intentionally left out of this article in order to drive curiosity and encourage you to build something on your own, rather than facilitating tutorial hell. All the code can be found and much more can found on the JavaScript Repository and is part of an open source book you learn in a remote development environment with GitPod.

请注意: 本文故意遗漏了最糟糕的部分,目的是激发好奇心并鼓励您自己构建一些东西,而不是使教程陷入困境。 可以在 JavaScript库 上找到所有代码,甚至可以找到更多代码,它们是 GitPod 的远程开发环境中学习的开源书籍的一部分

JavaScript和节点简介 (Introduction to JavaScript & Node)

If you are new to JavaScript or the Node.js ecosystem, I wrote an article about it which you can read in the link below.

如果您不熟悉JavaScript或Node.js生态系统,我会写一篇关于它的文章,您可以在下面的链接中阅读。

If you don’t know JavaScript or are still new, please note that our examples use ES6 features and features that are behind the experimental flag in node. These were not available when Node.JS first launched with the ES5 standard.

如果您不了解JavaScript或尚不熟悉JavaScript,请注意,我们的示例使用ES6功能以及node中实验标记后面的功能。 当Node.JS首次以ES5标准启动时,这些功能不可用。

HTTP:了解HTTP和HTML (HTTP: Understand HTTP and HTML)

Before we begin coding lets quickly go over what HTTP is by viewing the content of the slide. The terms in this slide are intended to help explain HTTP methods we’ll use.

在开始编码之前,让我们通过查看幻灯片的内容来快速了解HTTP是什么。 本幻灯片中的术语旨在帮助解释我们将使用的HTTP方法。

A slideshow explaining HTTP: can be found https://git.io/JUWbX for the blind.
Hans McMurdy — ©JavaScript-First: Hans McMurdy的照片—©JavaScript-First: HTTP Slides are accessible for the blind here HTTP幻灯片可供盲人使用

Put even more simply:

简单地说:

“When you, the reader are viewing this article, the browser (client) is making the request to the server. The server then sends a response (200 HTTP) as HTML, displaying the page with its content which is set to HTML”

“当您,读者正在阅读本文时,浏览器(客户端)正在向服务器发出请求。 然后,服务器以HTML格式发送响应(200 HTTP),显示其内容设置为HTML的页面”

Next, we’ll build a simple HTTP server that send HTML to the client (browser).

接下来,我们将构建一个简单的HTTP服务器,该服务器将HTML发送到客户端(浏览器)。

什么是HTML (What is HTML)

HTML is not a programming language despite what you read about on twitter, or what company those people work for, etc. It stands for Hyper Text Markup Language, because it’s a markup language. The short version of why it was created, was to allow academics to share documents with hyper text / hyper links across geographic space. 99% of the HTML you need to know to do this project or do web development can be explained in 1 minute, or one GIF. The other 1% comes down to project requirement research & practical experience.

尽管您在Twitter上读到的内容或这些人所从事的公司等等,HTML都不是一种编程语言。它代表超文本标记语言 ,因为它是一种标记语言。 之所以创建该文件,是为了让学者们在地理空间中共享带有超文本/超链接的文档。 1分钟或一个GIF就能解释您完成此项目或进行Web开发所需HTML的99%。 其余1%归因于项目需求研究和实践经验。

Image for post
Hans McMurdy — ©JavaScript-First: Explain HTML Hans McMurdy的照片—©JavaScript-First:介绍HTML

关于该项目: (About the project:)

The first example we’ll go over is how to read an

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值