Found 601 Articles for Front End Scripts

How not to validate HTML5 input with required attribute

Jennifer Nicholas
Updated on 25-Jun-2020 06:47:22

127 Views

To avoid validation, use the formnovalidate attribute in HTML5. In the example, validation is disabled for the 2nd button −Example           HTML formnovalidate attribute                        Rank                              

HTML5 video not playing in Firefox

Samual Sam
Updated on 25-Jun-2020 07:00:27

2K+ Views

HTML5 video should work in Firefox web browser. If it is still not working, try the following −Start Firefox in Safe Mode to check if any extension is creating issues.To reach Extensions, go to, Firefox/Tools > Add-ons > ExtensionsTry to turn off hardware acceleration.You need to check the media prefs that do not have the default value.If the media.windows-media-foundation.enabled is set to false, you need to set it to true and restart.Any of the above fixes should work.

How to disable zooming capabilities in responsive design with HTML5?

Ankith Reddy
Updated on 25-Jun-2020 07:02:19

637 Views

To disable zooming capabilities in responsive design, you need to create a META viewport tag.With that, set the user-scalable property to 'no' like −user-scalable=noAdd the following in your HTML code to disable zooming capabilities in responsive design −

How to preview an image before and after upload in HTML and JavaScript?

Vrundesha Joshi
Updated on 25-Jun-2020 07:01:37

2K+ Views

To preview an image before and after upload, you need to try the following code − HTML         The following is the jQuery −function display(input) {    if (input.files && input.files[0]) {       var reader = new FileReader();       reader.onload = function(event) {          $('#myid').attr('src', event.target.result);       }       reader.readAsDataURL(input.files[0]);    } } $("#demo").change(function() {    display(this); });

How to display HTML5 client-side validation error bubbles?

Arjun Thakur
Updated on 27-Jan-2020 09:25:50

229 Views

To display HTML5 client-side validation error bubbles, use the required attribute.You do not need to have JavaScript for client side validations like empty text box would never be submitted because HTML5 introduced a new attribute called required which would be used as follows and would insist to have a value:                    Enter email :          Try to submit using Submit button                    

Why does a stray HTML end tag generate an empty paragraph?

Lakshmi Srinivas
Updated on 30-Jul-2019 22:30:22

77 Views

The official HTML documentation states that you need to create a element if the closing p i.e. cannot be matched with existing tag.The HTML4 DTD states that the end tag is optional for the p element, but the start tag is required.However, the SGML declaration for HTML4 states that OMITTAG is YES that means the start tag can be implied.

Storing Credentials in Local Storage

Rishi Rathor
Updated on 30-Jul-2019 22:30:22

916 Views

The 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.For storing credentials in local storage, on successful login, generate a completely random string unrelated to user credentials. You need to store this in the database. Do not forget to add an expiry date. Pass that string to the JavaScript to be stored in local storage.As long as the local storage credential matches the database and ... Read More

How can I use Web Workers in HTML5?

karthikeya Boyini
Updated on 25-Jun-2020 06:33:56

110 Views

Web Workers allow for long-running scripts that are not interrupted by scripts that respond to clicks or other user interactions and allows long tasks to be executed without yielding to keep the page responsive.Web Workers are background scripts and they are relatively heavyweight and are not intended to be used in large numbers. For example, it would be inappropriate to launch one worker for each pixel of a four-megapixel image.Web Workers initialized with the URL of a JavaScript file, which contains the code the worker will execute. This code sets event listeners and communicates with the script that spawned it ... Read More

How to avoid repeat reloading of HTML video on the same page?

Nancy Den
Updated on 25-Jun-2020 06:34:54

692 Views

Use preload = ”auto” to avoid repeat reloading of HTML video on the same page −                                        Your browser does not support the video tag.          

HTML5 Canvas Circle Text

Ankith Reddy
Updated on 25-Jun-2020 06:37:12

333 Views

To create a text inside circles in canvas, use the −context.beginPath();ExampleThe following is the canvas −$("#demo").on("click", "#canvas1", function(event) {    var canvas = document.getElementById('canvas1');       if (canvas.getContext) {          var context = canvas.getContext("2d");          var w = 25;          var x = event.pageX;          var y = Math.floor(event.pageY-$(this).offset().top);                    context.beginPath();          context.fillStyle = "blue";          context.arc(x, y, w/2, 0, 2 * Math.PI, false);          context.fill();          context = canvas.getContext("2d");          context.font = '9pt';          context.fillStyle = 'white';          context.textAlign = 'center';          context.fillText('amit', x, y+4);       } });HTML    

Advertisements