Posts

Showing posts with the label javascript

Starting with HTML5 Forms

Image
HTML5 forms add a lot of power to html forms which result in reduced development time. And HTML5 are improved for developer as well as users using them. HTML5 specification added lots of feature in forms but all browsers are at different states. Check  www.html5test.com  for current support to HTML5 form elements. Below is the list of newly added input type in HTML5.  Input Type Purpose tel For entering a telephone number. search To prompt users to enter text that they want to search for. url For entering a single URL. email For entering either a single email address or a list of email addresses. datetime For entering a date and time with the time zone set to UTC. date For entering a date with no time zone. month For entering a date with a year and a month, but no time zone. week For entering a date that consists of a week-year number and a week number, but no tim...

Hello Vertx Javascript

Everyone is talking about node.js but another new kid in town is vert.x which is similar in nature to node (talking in terms of javascript server side programming). So today we will write Hello World in vertx.    Steps ::  Click  here  to download vertx or go to vertx home page here Create environment variable VERTX_HOME with value as extracted vertx directory Add %VERTX_HOME%\bin to %PATH% Now you are ready to code. Here is the code load('vertx.js') //Configure Vertx server to listen on port 8080 for incoming http requests vertx.createHttpServer().requestHandler(function(req) {   req.response.end("<html><body><h1>Hello from vert.x!</h1></body></html>"); }).listen(8080, 'localhost'); stdout.println("Server is running on " + "http://127.0.0.1:8080"); Save above code as server-helloworld.js Start node server as >vertx  run server-helloworld.js Server is running o...

Starting With Node on Windows - Part2

In last post   we start with node on windows and create a simple console based "Hello World" program in node. But node is designed to serve on HTTP protocol so today we will write our 1st server side node program. Here is the code //Load http module required for http protocol communications var http = require('http'); //Configure http server to respond all request with Hello World From Node Server var server = http.createServer(function (request, response) { response.writeHead(200, {"Content-Type": "text/plain"}); response.end("Hello World From Node Server\n"); }); // Listen on port 8080, IP defaults to 127.0.0.1 server.listen(8080); // Put a friendly message on the terminal console.log("Server running at http://127.0.0.1:8080/"); Save above code as server-helloworld.js Start node server as >node server-helloworld.js Server running at http://127.0.0.1:8080/ Now go to http://127.0.0.1:8080/  ...

Starting With Node on Windows

Hello World is good way to go with any new language/framework in programming world. Today we will start with Node.js which takes javascript to server side. Setup      1. Download Node from  here      2. Add a new environment variable NODE_HOME and also add this variable in windows PATH Thats all! Now you are ready to rock and roll. Hello World - Console console.log("Hello World"); Save this line as Hello-colsole.js Run it from windows command line >node Hello-cosole.js Hello World