
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
Karthikeya Boyini has Published 2193 Articles

karthikeya Boyini
218 Views
Yes, the official specification states cross-origin attribute as:The crossorigin attribute is a CORS settings attribute. Its purpose is to allow images from third-party sites that allow cross-origin access to be used with canvas.You can use it to solve JavaScript errors like to log js errors:if (securityOrigin()->canRequest(targetUrl)) { msg = ... Read More

karthikeya Boyini
248 Views
To draw large font properly in HTML5 Canvas, you can try to run the following code:var myCanvas = document.getElementById("myCanvas"); var context = c.getContext("2d"); context.font = '180pt Georgia'; context.strokeStyle = "#FF0000"; context.fillStyle = "#FFFFFF "; context.lineWidth = 34; context.fillText("Demo!",0,200); context.strokeText("Demo!",0,200);

karthikeya Boyini
2K+ Views
To blend, you need to perform blending of two images in proportion 50-50.Let us see how: Blended image window.onload = function () { var myImg1 = document.getElementById('myImg1'); var myImg2 = document.getElementById('myImg2'); var myCanvas = document.getElementById("canvas"); ... Read More

karthikeya Boyini
362 Views
A new feature introduced in HTML 5 is the addition of custom data attributes.A custom data attribute starts with data- and would be named based on your requirement. ... The above will be perfectly valid HTML5 with two custom attributes called data-subject and data-level. You would be able to ... Read More

karthikeya Boyini
672 Views
Here is an example of an error handling function in a Web Worker JavaScript file that logs errors to the console.ExampleWith error handling code, above example would become like the following: Big for loop var worker ... Read More

karthikeya Boyini
322 Views
To resize the image before submitting the form, you need to use the drawImage() method.Scale the original image and draws the scaled version on the canvas at [0, 0]context.drawImage( img, 0, 0, img.width, img.height, 0, 0, myWidth, UseHeight );Above, we saw the following:Here, var myWidth = Math.floor( img.width * Scale ... Read More

karthikeya Boyini
519 Views
The HTML5 file Blob.slice() method is useful for creating a Blob object containing the data. This data is in the specified range of bytes of the source Blob. It uses XMLHttpRequest as in the below example.Let us see an example to send and receive binary data using slice(). This example ... Read More

karthikeya Boyini
351 Views
To keep the image at the back of the canvas, when move elements, you need to pass:preserveObjectStackingAnd the following would work and the image is not visible in the background:window.canvas = new fabric.Canvas('c', { preserveObjectStacking:true });Now, on moving the shape will appear over the image.

karthikeya Boyini
169 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]

karthikeya Boyini
268 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!'); }Read More