相关疑难解决方法(0)

了解Layman术语中的异步代码

我理解异步的基本内容:事情不按顺序执行.据我所知,有一些非常强大的东西...... 但对于我的生活,我无法绕过代码.让我们来看看我写过的异步Node.JS代码......但是没有真正得到.

function newuser(response, postData) {
    console.log("Request handler 'newuser' was called.");
    var body = '<html>' + 
        '<head>' +
        '<meta http-equiv="Content-Type" content="text/html; ' +
        'charset=UTF-8" />' +
        '</head>' +
        '<body>' +
        '<form action=" /thanks" method="post">' +
        '<h1> First Name </h1>' +
        '<textarea name="text" rows="1" cols="20"></textarea>' +
        '<h1> Last Name </h1>' +
        '<textarea name="text" rows="1" cols="20"></textarea>' +
        '<h1> Email </h1>' +
        '<textarea name="text" rows="1" cols="20"></textarea>' +
        '<input type="submit" value="Submit text" />' +
        '</body>' +
        '</html>';
    response.writeHead(200, { "Content-Type": "text/html" });
    response.write(body);
    response.end(); …
Run Code Online (Sandbox Code Playgroud)

javascript asynchronous node.js

19
推荐指数
2
解决办法
1万
查看次数

标签 统计

asynchronous ×1

javascript ×1

node.js ×1