Found 2202 Articles for HTML

HTML 5 local Storage size limit for sub domains

Sreemaha
Updated on 04-Mar-2020 04:57:24

607 Views

HTML5's localStorage databases are size-limited. The standard sizes are 5 or 10 MB per domain. A limit of 5 MB per origin is recommended.The following is stated −User agents should guard against sites storing data under their origin's other affiliated sites, e.g. storing up to the limit in a1.example.com,a2.example.com, a3.example.com, etc, circumventing the mainexample.com storage limit.For size limit −A mostly arbitrary limit of five megabytes per origin is suggested. Implementation feedback is welcome and will be used to update this suggestion in the future.

How can I use the HTML5 canvas element in IE?

Chandu yadav
Updated on 04-Mar-2020 04:53:16

297 Views

Use excanvas JavaScript library to use HTML5 canvas in Internet Explorer(IE).The excanvas library is an add-on, which will add the HTML5 canvas functionality to the old IE browsers (IE7-8).Firefox, Safari and Opera 9 support the canvas tag to allow 2D command-based drawing operations.ExplorerCanvas brings the same functionality to Internet Explorer. To use the HTML5 canvas element in IE, include the ExplorerCanvas tag in the same directory as your HTML files, and add the following code to your page in the head tag.

How to fix getImageData() error ‘The canvas has been tainted by cross-origin data’ in HTML?

George John
Updated on 04-Mar-2020 04:52:20

2K+ Views

The crossOrigin attribute allows images that are loaded from external origins to be used in canvas like the one they were being loaded from the current origin.Using images without CORS approval tains the canvas. Once a canvas has been tainted, you can no longer pull data back out of the canvas. By loading the canvas from cross origin domain, you are tainting the canvas.You can prevent this by setting −img.crossOrigin = "Anonymous";This works if the remote server sets the header aptly −Access-Control-Allow-Origin "*"

How to programmatically empty browser cache with HTML?

usharani
Updated on 01-Jun-2020 10:53:08

2K+ Views

You can tell your browser not to cache your page by using the following meta tags − In addition, try the following:  Append a parameter/string to the filename in the script tag. Change it when the file changes.Then the next time you update the file, just update the version i.e.

Is it possible to style HTML5 audio tag?

varma
Updated on 04-Mar-2020 04:50:27

4K+ Views

HTML 5 audio tags can be styled. By using the audio tag with “controls” attribute, the default browsers player is used. You can customize by not using the browsers controls. By removing the controls attribute, you can hide the built in browser user’s interface −    Play    Pause    Vol+    Vol- You can also add CSS classes to each one of the elements and style them accordingly.

Checking if a key exists in HTML5 Local Storage

Sreemaha
Updated on 24-Jun-2020 12:30:42

2K+ Views

The getitem(key) takes value for one parameter and returns the value associated with the key. The given key is present in the list associated with the object.if(localStorage.getItem("user")===null) {    //... }But if the key is not present in the list then it passes null value by using the below-given codeYou can also follow the below-given procedure −if("user" in localStorage){    alert('yes'); } else {    alert('no'); }

Drawing text to HTML5 with @fontface does not work at the first time

Chandu yadav
Updated on 01-Jun-2020 10:58:45

507 Views

 Drawing text in a canvas with a typeface that is loaded via @font-face does not show text correctly at first. This is because the browser has not yet loaded the font from network. Therefore, it makes use of the font, which is already available.The font has to be completed loaded before it is used. This can be ensured using tag. If you want to make sure that the font is available and have some other elements preloaded, then you can do this by using the tag as under  You can also load font like this −var newFont = ... Read More

Maximum size of a element in HTML

Arjun Thakur
Updated on 30-Jul-2019 22:30:22

2K+ Views

 All web browsers limit the canvas element’s width, height, and area.For Google Chrome, the maximum allowable width and height are 32,767 pixels and the maximum allowable area is 268,435,456 pixels.For Firefox, the maximum allowable width and height are 32,767 pixels and the maximum allowable area is 472,907,776 pixels. For IE, the maximum allowable width and height are 8,192 pixels. For IE Mobile, the maximum allowable width and height are 4,096 pixels.

How to center canvas in HTML5?

vanithasree
Updated on 03-Mar-2020 12:46:08

11K+ Views

To center canvas in HTML 5, include the canvas tag in div tag. Then we can center align the div tag. By doing so, the canvas is also center aligned.Example.                    This is my canvas          

HTML5 inline video on iPhone vs iPad/Browser

Chandu yadav
Updated on 03-Mar-2020 12:44:55

498 Views

The allowsInlineMediaPlayback  property of a UIWebView) enables/ disables in line media playback in the iOS web browser for a native app. By default, on iPhone this is set to NO, but on iPad its set to YES. Hence, the native video player takes over the screen, thus obstructing us from playing other dynamic content simultaneously with the video Adjust this behaviour in HTML as follows − iOS10+ In iOS 10+, Apple has now enabled the attribute playsinline in all the web browsers on iOS 10. Now, play around with this easily −

Advertisements