

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use sockets in JavaScriptHTML?
To use sockets, consider the WebSocket interface in JavaScript. This interface enables web applications to maintain bidirectional communications with server-side processes.
To enable Web applications to maintain bidirectional communications with server-side processes, this specification introduces the WebSocket interface.
Here are some of the methods to workaround with Web Sockets −
socket = new WebSocket(url [, protocols ] )
Create a new socket using this, wherein parameters URL is a string for the connection and protocols is a string or array of string.
socket . send( data )
The above is used to send data.
Used to close the socket connection.
socket . close( [ code ] [, reason ] )
The following returns the URL used to establish the connection.
socket . url
- Related Questions & Answers
- How to use sockets in JavaScript\HTML?
- What is Sockets?
- Interprocess Communication with Sockets
- How to use JavaScript to redirect an HTML page?
- How to use blockquote in HTML?
- How to use an HTML button to call a JavaScript function?
- How to use Style Sheet in HTML?
- How to use Emphasized formatting in HTML?
- How to use small formatting in HTML?
- How to use small font in HTML?
- How to use quotation marks in HTML?
- How to use autocomplete attribute in HTML?
- How to use formnovalidate attribute in HTML?
- How to use formaction attribute in HTML?
- How to use formenctype attribute in HTML?
- How to use formtarget attribute in HTML?
Advertisements