Chandu yadav has Published 1163 Articles

HTML5 display as image rather than “choose file” button

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 05:31:47

244 Views

Use the JavaScript FileReader to allow users to choose an image.Let us see an example −         Here is the JS −function readURL(input) {    if (input.files && input.files[0]) {       var r = new FileReader();       r.onload = function (ev) {          $('#myid).attr('src', ev.target.result);       }       reader.readAsDataURL(input.files[0]);    } }   

CSS shorthand property for the flex-grow, flex-shrink, and the flex-basis properties

Chandu yadav

Chandu yadav

Updated on 24-Jun-2020 15:39:24

127 Views

Use the flex property to add flex-grow, flex-shrink and flex-basis properties in a single line.You can try to run the following code to implement the flex propertyExampleLive Demo                    .mycontainer {             display: flex;     ... Read More

How to reload the current page without losing any form data with HTML?

Chandu yadav

Chandu yadav

Updated on 24-Jun-2020 14:22:10

7K+ Views

The easiest way to reload the current page without losing form data, use WebStorage where you have -persistent storage (localStorage) or session-based (sessionStorage) which remains in memory until your web browser is closed.Try this when the page is about to reload, window.onbeforeunload = function() {    localStorage.setItem(name, $('#inputName').val());    localStorage.setItem(phone, ... Read More

Facing Problem in retrieving HTML5 video duration

Chandu yadav

Chandu yadav

Updated on 24-Jun-2020 14:17:58

343 Views

To get the video duration, query the readyState attribute. It has a series from 0 to 4. When the metadata has loaded, the value you will get is 1.Therefore, you need to do something like −window.setInterval(function(tm) {    // Using readyState attriute    if (video.readyState > 0) {     ... Read More

Flexbox and vertical scroll in a full-height app using newer Flexbox API with HTML

Chandu yadav

Chandu yadav

Updated on 24-Jun-2020 14:16:04

443 Views

The flex property is a shorthand for the flex-grow, flex-shrink, and flex-basis properties. The flex property sets the flexible length on flexible items.For example −#container article {    -webkit-flex: 1 1 auto;    overflow-y: auto;    height: 0px; /*here the height is set to 0px*/ }If you want a min-height, ... Read More

What is the best data type to store money values in MySQL?

Chandu yadav

Chandu yadav

Updated on 24-Jun-2020 14:16:00

5K+ Views

We can store the money values in MySQL in decimal(value1, value2). Here, value1 is the total range including value2. The value2 specifies the number of digits after the decimal point. To understand this concept, the steps are given below.First a table is created using the create command.mysql> CREATE table MoneyDemo ... Read More

Find records from one MySQL table which don't exist in another?

Chandu yadav

Chandu yadav

Updated on 24-Jun-2020 14:12:31

662 Views

To find the records from one MySQL table which don’t exist in another table we can use the subquery for the table which does not have the records. This can be better understood using the given steps −First a table is created using the create command. The table name is ... Read More

EventSource vs. wrapped WebSocket with HTML5 Server-Side Event

Chandu yadav

Chandu yadav

Updated on 24-Jun-2020 14:11:46

90 Views

The event source is just a web socket that -That cannot send data Uses text or event stream format It fires events that are server definedIt is useful in applications that only need server push.Web sockets are good for applications that need fast communications in both directions.Another major difference is the different ... Read More

How can I stop running a MySQL query?

Chandu yadav

Chandu yadav

Updated on 24-Jun-2020 14:09:41

911 Views

Before stopping a running query of MySQL, first we need to see how many processes are running with the help of show command.The query for that is given as follows −mysql> show processlist;After executing the above query, we will get the output with some id’s. This is given as follows ... Read More

Variables in CSS

Chandu yadav

Chandu yadav

Updated on 24-Jun-2020 14:07:02

107 Views

Variables in CSS are used to add custom property values to your web page. Set a custom name of the property and set value for it.You can try to run the following code to implement variables in CSS to change the background and text colorExampleLive Demo       ... Read More

Advertisements