【笔记】Nodejs中使用jQueryAJAX 发表于 2023-06-18 更新于 2024-05-18 阅读次数: 前言Nodejs中使用jQueryAJAX,允许跨域访问 下载依赖1npm install ajax-for-node 发送AJAX请求123456789101112131415161718const nodeAjax = require('ajax-for-node');nodeAjax({ url: "https://echo.apipost.cn/get.php", data: formData, type: "POST", processData: false, contentType: false, success: function (data, status, xhr) { console.log(data, status, xhr) }, error: function (xhr, status, error) { console.log(xhr, status, error) }, complete: function (xhr, status) { console.log(xhr, status) }}); 完成参考文献Apipost-Team/nodeajax