Jump to content

Search the Community

Showing results for tags 'node.js'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 6 results

  1. disease

    Node.js file server problems

    Hey there, I have followed the tutorial for the w3 raspberry pi led pwm Gpio controller using node.js (https://www.w3schools.com/nodejs/nodejs_raspberrypi_rgb_led_websocket.asp) unfortunately though it uses internal scripts and stylesheets. I have tried using express.static to set up file hosting but I couldn’t get it to work. I am needing to host additional files for the web server to read. I am fairly new at node.js so it might have been the way I was trying to implement it that caused the issue. Thanks in advance
  2. Nuur

    Node.js Tutorial

    What About Adding Node.js As Another Tutorial In The Server-Side Languages? to complete the chain of JavaScript and to teach the newer, modern and the attractive part of the language...why not? I am not recommending specific framework W3SCHOOLS can choice any of the available, but please the best! WHY ADDING: I am not here to explain the power of Node.js...Please Google this WHY IT'S NECESSARY: Large companies are using and coming to Node e.g...[Google this also ], and large apps are written with it[Do Not Forget Our friend..Google]. not only it's "Popular", but also fast(because of the non-blocking I/O, being V8 based and more[Google!!!]) THANKS FOR: ADDING NODE AS THE THIRD LANGUAGE
  3. nyeko_92

    Adding Classes?

    When will you add react.js, express.js,angular2, Zurb foundation(web framework),Ruby on Rails and node.js classes(which very commonly used for most of the websites)?
  4. Eyad Syria-lover

    Suggestion:Add A Tutorial About Node.js ...

    w3schools.com Is Amazing Resource For Those Who Would Like To Learn Web Development,Adding A Node.js Tutorial To It Will Make The Site Better,Since W3schools Is Presenting The Web Development Ideas In A Simplified Way...
  5. Hi, I am using express framework form to get inputs from user and sending it as email by using node mailer. However i am unable to receive the image and system type (Combo box).I am new to node.kindly help. ### My HTML code ``` <div class="container"> <p style="font-size:24px;">ONLINE SUPPORT REQUEST</p> <hr size="2%;"width="50%;"> <form role="form" name="myForm" onsubmit="return(validate());" action="http://127.0.0.1:8081/process_post" method="POST" > <div class="form-group"> <label for="name">What is your name?</label> <input type="text" class="form-control" id="text" name="fname" placeholder="name"> </div> <div class="form-group"> <label for="cname">What is your company name?</label> <input type="text" class="form-control" id="text" name="cname" placeholder="company name"> </div> <div class="form-group"> <label for="email">What is your email address?</label> <input type="email" class="form-control" id="email" name="email" placeholder="Enter email"> </div> <div class="form-group"> <label for="phone">What is your phone number?</label> <input type="text" class="form-control" id="text" name="phone" placeholder=" phone number with area code"> </div> <div class="form-group"> <label for="one">Is this an emergency? </label> <input type="radio" class="form-control" id="text" name="emergency" value="No"> NO <input type="radio" class="form-control" id="text" name="emergency" value="Yes"> YES </div> <div class="form-group"> <label for="one">Do you require a phone call when we begin working on your ticket? </label> <input type="radio" class="form-control" id="text" name="phonecall" value="No"> NO <input type="radio" class="form-control" id="text" name="phonecall" value="Yes"> YES </div> <div class="form-group"> <label for="combo" name="systemtype"> What is your system platform</label> <br> <select> <option value="volvo">Microsoft Windows</option> <option value="saab">Mac OS X</option> <option value="opel">Linux</option> <option value="audi">IOS</option> <option value="5">Android</option> <option value="6">Others</option> </select> </div> <div class="form-group"> <label for="uploadfile"> Please attach a screenshot if applicable.</label> <input type="file" class="form-control" id="text" name="attachment" size="50"> <br> <input type="submit" value="Upload File" /> </div> <div class="form-group"> <label for="name">What is the subject of your support request?</label> <input type="text" class="form-control" id="text" name="supportrequest" placeholder="suport subject"> </div> <div class="form-group"> <label for="comment">Please describe the support issue in detail </label> <textarea class="form-control" rows="5" id="comment" name="urcomments"></textarea> </div> <button type="submit" class="btn btn-default">Submit</button> </form> </div> <br> ``` ### My server Code ```js var express = require('express'); var app = express(); var fs = require("fs"); var bodyParser = require('body-parser'); var multer = require('multer'); // Create application/x-www-form-urlencoded parser var urlencodedParser = bodyParser.urlencoded({ extended: false }) app.use(express.static('public')); var upload = multer({ dest: './uploads' }); app.get('/client-support.htm', function (req, res) { res.sendFile( __dirname + "/" + "client-support.htm" ); }) app.post('/process_post', urlencodedParser, function (req, res) { // Prepare output in JSON format response = { fname:req.body.fname, cname:req.body.cname, email:req.body.email, phone:req.body.phone, emergency:req.body.emergency, phonecall:req.body.phonecall, systemtype:req.body.systemtype, attachment:req.body.attachment, supportrequest:req.body.supportrequest, urcomments:req.body.urcomments }; console.log(response); res.end(JSON.stringify(response)); console.log(req.files.file.name); console.log(req.files.file.path); console.log(req.files.file.type); var file = __dirname + "/" + req.files.file.name; fs.readFile( req.files.file.path, function (err, data) { fs.writeFile(file, data, function (err) { if( err ){ console.log( err ); }else{ response = { message:'File uploaded successfully', filename:req.files.file.name }; } console.log( response ); res.end( JSON.stringify( response ) ); }); }); //sudan file upload edit end //sudan edited node mailer code below var nodemailer = require('nodemailer'); // create reusable transporter object using the default SMTP transport // setup e-mail data with unicode symbols var mailOptions = { from: 'xxxxxxxx.com', // sender address to: 'xxxxxxxxx.com', // list of receivers subject: 'Client Support Page - Client Details', // Subject line text: 'you have a new submission with folowwing details....Name:'+req.body.fname+'cname:'+req.body.cname+'Email:'+req.body.email+'Phone:'+req.body.phone+'emergency:'+req.body.emergency+'phonecall:'+req.body.phonecall+'systemtype:'+req.body.systemtype+'attachment:'+req.body.attachment+'supportrequest:'+req.body.supportrequest+'urcomments:'+req.body.urcomments, // plaintext body html: '<table border="1" style="width:100%"><tr style="background-color:#373737;color:#ffffff;"><td><b>DETAILS LIST</b></td><td><b>CLIENT DETAILS</b></td></tr><tr style="background-color: #eee;"><td><b>Name:</b></td><td>'+req.body.fname+'</td></tr><tr><td><b>Email:</b></td><td>'+req.body.email+'</td></tr><tr style="background-color: #eee;"><td><b>Phone:</b></td><td>'+req.body.phone+'</td></tr><tr><td><b>emergency:</b></td><td>'+req.body.emergency+' </td></tr><tr style="background-color: #eee;"><td><b>phonecall:</b></td><td>'+ req.body.phonecall +' </td> </tr><tr><td><b>systemtype:</b></td><td>'+req.body.systemtype +'</td></tr><tr style="background-color: #eee;"><td><b>attachment:</b></td><td>'+req.body.attachment +' </td></tr><tr><td><b>supportrequest:</b></td><td>'+ req.body.supportrequest +' </td></tr></table>'// html body }; // send mail with defined transport object transporter.sendMail(mailOptions, function(error, info){ if(error){ return console.log(error); } console.log('Message sent: ' + info.response); }); }) var server = app.listen(8081, function () { var host = server.address().address var port = server.address().port })
  6. Hello there, I am plan (in near future) to start with learning and training with node.js. Since I have habit to learn and remind from w3s (manner of writing), do you plan to add some tutorials and references for node.js? Thank you for all!
×