Found 444 Articles for Programming Scripts

Number.MIN_SAFE_INTEGER Property in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:42:30

94 Views

The Number.MIN_SAFE_INTEGER property of the Number object represents the minimum safe integer in JavaScript (i.e. –(253 – 1)).SyntaxIts Syntax is as followsNumber.MIN_SAFE_INTEGERExample Live Demo    JavaScript Example           var result = Number.MIN_SAFE_INTEGER;       document.write("Minimum safe integer: " + result);     OutputMinimum safe integer: -9007199254740991

Number.MAX_SAFE_INTEGER Property in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:43:22

128 Views

The Number.MAX_SAFE_INTEGER property of the Number object represents the maximum safe integer in JavaScript (i.e. 253 - 1).SyntaxIts Syntax is as followsNumber.MAX_SAFE_INTEGERExample Live Demo    JavaScript Example           var result = Number.MAX_SAFE_INTEGER;       document.write("Maximum safe integer: " + result);     OutputMaximum safe integer: 9007199254740991

volatile keyword in C#

Samual Sam
Updated on 20-Jun-2020 17:21:20

748 Views

To reduce concurrency issues in C#, use the volatile keyword. Let us seen an example.The following is how you use a volatile keyword for public variable −class Program {    public volatile int a;    public void Program(int _a) {       i = _i;    } }Let us see another example: We have two static variables. Set them in a new method −_out = "Welcome!"; _new = true;We declared them as static before using volatile −static string _out; static volatile bool new;Now you need to run the method on a thread −new Thread(new ThreadStart(volatileFunc)).Start();Read the value of the ... Read More

Adding an element in an array using Javascript

Samual Sam
Updated on 15-Jun-2020 14:41:58

213 Views

Adding an element to an array can be done using different functions for different positions.Adding an element at the end of the arrayThis can be accomplished using the push method. For example, let veggies = ["Onion", "Raddish"]; veggies.push("Cabbage"); console.log(veggies);This will give the output −["Onion", "Raddish", "Cabbage"]You can also use this to push multiple items at the same time as it supports a variable number ofarguments. For example, let veggies = ["Onion", "Raddish"]; veggies.push("Cabbage", "Carrot", "Broccoli"); console.log(veggies);This will give the output −["Onion", "Raddish", "Cabbage", "Carrot", "Broccoli"]Adding an element at the start of the arrayThis can be accomplished using the unshift method. ... Read More

Detect compatibility of the new HTML5 tag with jQuery.

Daniol Thomas
Updated on 29-Jan-2020 06:30:38

143 Views

Use the following to check the compatibility of the HTML5 tag :var $myEL = $(''); $myEL.appendTo('body'); var bgColor = $myEL.css('backgroundColor'); if (/rgb\(255\, 255\, 0\)/.test(bgColor))    return true; else    return false;

Using FFMPEG with HTML5 for online video hosting

Samual Sam
Updated on 30-Jul-2019 22:30:22

1K+ Views

HTML5 enabled browsers to have a video element that you can use to play a video on your site. To let you know, flowplayer and other flash based video streaming players use the FLV format. It has the same encoding as H.264. FFMPEG can convert videos to FLV, feel free to work it with flowplayer. Use the flvtool2 for reading and writing FLV metadata from and to the file. Use the tools to create your videos and stream them through flowplayer.

Difference between MessageChannel and WebSockets in HTML5

Smita Kapse
Updated on 30-Jul-2019 22:30:22

193 Views

Web Sockets is a next-generation bidirectional communication technology for web applications that operates over a single socket and is exposed via a JavaScript interface in HTML 5 compliant browsers. Once you get a Web Socket connection with the web server, you can send data from browser to server by calling a send() method, and receive data from server to browser by an onmessage event handler.Two way communication between the browsing contexts is called channel messaging. It is useful for communication across multiple origins.While creating messageChannel, it internally creates two ports to sending the data and forwarded to another browsing context. ... Read More

HTML5 Canvas distorted

Chandu yadav
Updated on 16-Dec-2021 12:28:24

671 Views

If the canvas looks distorted, then try to change the height and width −The default height and width of the canvas in HTML5 is of 2/1 ratio −width = 300 height = 150ExampleLet us see an example −                    #mycanvas{border:1px solid red;}                         Output

Passing mouse clicks through an overlaying HTML element

Ankith Reddy
Updated on 25-Jun-2020 07:05:20

1K+ Views

Retrieve the mouse coordinates in the click event. Now, retrieve the element by hiding your overlay, and use the following. After that, redisplay the overlay −document.elementFromPoint(x, y)You can also use the following CSS −div {    pointer-events:none; }

HTML5 Input type “number” in Firefox

karthikeya Boyini
Updated on 04-Jun-2020 09:35:44

867 Views

The min attribute of the input type number isn’t supported by Firefox, but it works correctly in Google Chrome.ExampleLet us see an example −           HTML input number                        Mention any number between 1 to 10                              

Advertisements