Tôi muốn tải tệp jquery cục bộ trong ứng dụng trò chuyện js nút của tôi. Tôi đã tìm kiếm rất nhiều nhưng tôi không thể tìm được giải pháp thích hợp.Tải tệp jquery.js cục bộ vào nút js
<!doctype html>
<html>
<head>
<title>Socketio</title>
</head>
<body>
<!--This wont work -->
<script src="/socket.io/jquery.min.js"></script>
<!--This will work -->
<script src="/socket.io/socket.io.js"></script>
</body>
</html>
tôi chỉ cần sao chép tập tin jquery.js để socket.io
folder.The socket.io.js
file nạp đúng nhưng tập tin jquery didnt.Please giúp tôi Dưới đây là index.js tôi nộp
var app = require('express')();
var server = require('http').Server(app);
var io = require('socket.io')(server);
app.get('/', function(req, res){
res.sendFile(__dirname + '/index.html');
});
server.listen(3000, function(){
console.log('listening on *:3000');
});
Bạn cần jQuery ở phía máy chủ để làm gì? Có lẽ bạn muốn tải nó trên index.html? – Burimi
Có, tôi muốn tải tệp trong ứng dụng khách –
Chỉ cần đặt nó như bình thường trên index.html – Burimi