
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Found 598 Articles for Front End Scripts

202 Views
Create a new web browsing context either by creating new iframe or new window. We can send the data using with postMessage() and it has two arguments. They are asmessage − The message to sendtargetOrigin − Origin nameLet us see an example to send a message from iframe to button:var iframe = document.querySelector('iframe'); var button = document.querySelector('button'); var clickHandler = function(){ iframe.contentWindow.postMessage('The message to send.','https://www.tutorialspoint.com); } button.addEventListener('click',clickHandler,false);

183 Views
Microdata introduces five global attributes that would be available for any element to use and give context for machines about your data.AttributeDescriptionItemscopeThis is used to create an item. The itemscope attribute is a boolean attribute that tells that there is Microdata on this page, and this is where it starts.Itemtype This attribute is a valid URL which defines the item and provides the context for the properties.ItemidThis attribute is a global identifier for the item.ItempropThis attribute defines a property of the item.ItemrefThis attribute gives a list of additional elements to crawl to find the name-value pairs of the item.Read More

154 Views
HTML5 canvas provides capabilities to create nice shadows around the drawings. All drawing operations affected by the four global shadow attributes. Sr.No. Property and Description1shadowColor [ = value ]This property returns the current shadow color and can be set, to change the shadow color.2shadowOffsetX [ = value ]This property returns the current shadow offset X and can be set, to change the shadow offset X.3shadowOffsetY [ = value ]This property returns the current shadow offset Y and can be set, ... Read More

167 Views
To handle Server-Sent Events in HTML5, you can try to run the following code: document.getElementsByTagName("eventsource")[0].addEventListener("server-time", eventHandler, false); function eventHandler(event) { // Alert time sent by the server document.querySelector('#ticker').innerHTML = event.data; } [TIME]

811 Views
Session StorageThe Session Storage is designed for scenarios where the user is carrying out a single transaction but could be carrying out multiple transactions in different windows at the same time.Local StorageThe Local Storage is designed for storage that spans multiple windows and lasts beyond the current session. In particular, Web applications may wish to store megabytes of user data, such as entire user-authored documents or a user's mailbox, on the client side for performance reasons.HTML5 introduces the localStorage attribute which would be used to access a page's local storage area without no time limit and this local storage will ... Read More

239 Views
The HTML5 tag is used to draw SVG Gradients. Yes, modern browsers support it.The following is the HTML5 version of an SVG example that would draw an ellipse using the tag and would use the tag to define an SVG radial gradient. Similar way you can use the tag to create SVG linear gradient. #svgelem{ position: relative; left: 50%; -webkit-transform: translateX(-40%); -ms-transform: translateX(-40%); transform: translateX(-40%); } SVG HTML5 SVG Gradient Ellipse

230 Views
To apply gravity between two or more object in Canvas:var distX = ob1.x - ob2.x, distY = ob1.y - ob2.y; var val = distX *distX + distY * distY; var r = Math.sqrt(val); var F = 50 / val; var rhat_x = distX / r; var rhat_y = distY / r; var Fx = F * rhat_x; var Fy = F * rhat_y; ob1.vx += -Fx; ob1.vy += -Fy; ob2.vx += Fx; ob2.vy += Fy;

238 Views
For responsive design, you do not have to use user-scalable=no. Use it only if you want your application to look more like a native app.Zooming is a key feature for accessibility and you need to keep that in mind. You can control that users won't break your design if they zoom in. If you are doing responsive and your design breaks when zooming in, then you're not doing it right.If you totally need to use it, then keep in mind that zooming is an important accessibility feature that is used by many people.

267 Views
Change the setTimeout() to use a function reference. It works as the function available at the time the reference.The reference will be transferred to the timeout event callback rather than a string reference:window.setTimeout(startNow, 2000);Set it like the following:setTimeout(startNow, 1000); function startNow () { alert(‘Working correctly!'); }