Allow Restricted Resources from Another Domain in Web Browser with HTML5

Smita Kapse
Updated on 29-Jan-2020 10:50:07

324 Views

Cross-origin resource sharing (CORS) is a mechanism to allows the restricted resources from another domain in a web browserFor suppose, if you click on HTML5- video player in html5 demo sections. it will ask camera permission. if user allows the permission then only it will open the camera or else it doesn't open the camera for web applicationsHere Chrome, Firefox, Opera and Safari all use the XMLHttprequest2 object and Internet Explorer uses the similar XDomainRequest object, object.function createCORSRequest(method, url) {    var xhr = new XMLHttpRequest();    if ("withCredentials" in xhr) {       // Check if the XMLHttpRequest ... Read More

Validate the Size of Input File in HTML5

Govinda Sai
Updated on 29-Jan-2020 10:49:35

2K+ Views

You can try to run the following code to validate the size of input type file:                                                                                                   $(function(){                $('form').submit(function(){                   var val = true;                       $('input[type=file][data-max-size]').each(function(){                   if(typeof this.files[0] !== 'undefined'){                      var max = parseInt($(this).attr('max-size'),10),                      mySize = this.files[0].size;                      val = max > mySize;                      return val;                   }                });                return val;             });          });          

Autorun a Python Script on Windows Startup

Arnab Chakraborty
Updated on 29-Jan-2020 10:43:54

1K+ Views

Appending a Python script to windows start-up basically indicates the python script will run as the windows boots up. This can be accomplished by two step processes -Step #1: Appending or Adding script to windows Startup folderAfter booting up of the windows, it executes (equivalent to double-clicking) all the application present in its startup folder or directory.AddressC:\Users\current_user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\By default, the AppData directory or folder under the current_user is hidden that enable hidden files to get it and paste the shortcut of the script in the given address or the script itself. Besides this the .PY files default must be set ... Read More

Adding HTML5 Validation to Visual Studio

Sravani S
Updated on 29-Jan-2020 10:25:41

660 Views

For HTML5 validation, you need to install IntelliSense and validation support to Visual Studio. HTML5 is supported by Visual Studio 2012.VS 2010 had IntelliSense support, but VS 2012 added corresponding snippets making it fast and easy to write markup.Follow the steps: Launch Visual Studio 2012 Go to Tools > Options menu When Options configuration screen is displayed, go to Text Editor > HTML > Validation.

Usage of Section and Article Elements in HTML

Nitya Raut
Updated on 29-Jan-2020 10:24:41

164 Views

The elements and are useful for screenreaders as well and help visually impaired users in reading the content of your web page. These are beneficial for eBook readers as well.Let us see how to work with both the elements.           HTML Section Tag                        Java          Inheritance          Inheritance defines the relationship between superclass and subclass.                              Learning          Learn to gain experience and try to share your knowledge with others.                       Web Development Tutorials             Consist of CSS, HTML, and PHP tutorials for 2nd Semester exams.                                 Academic Tutorials             Consist of Computer Fundamental, Computer Network tutorials for             1st Semester exams.                    

Cross-Origin Attribute in HTML5

karthikeya Boyini
Updated on 29-Jan-2020 10:23:18

232 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 = myErroe;    line = myLineNumber;    source = sourceURL; } else {    msg = "Error!";    source = String();    line = 0; }

HTML5 Preload Attribute

Anvi Jain
Updated on 29-Jan-2020 10:22:10

161 Views

To prevent HTML5 video from loading before playing, use preload attribute. You can try to run the following code:                                        Your browser does not support the video tag.          

Positioning HTML5 SVG in the Center of Screen

Sravani S
Updated on 29-Jan-2020 10:20:13

373 Views

To center SVG, add the following CSS:# svgelem {    margin-left:auto;    margin-right:auto;    display:block; }The following is our SVG:    

HTML5 File Blob slice Method

Samual Sam
Updated on 29-Jan-2020 10:19:14

337 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.Let us see an example to send and receive binary data using slice(). This example sends a text and uses the POST method to send the "file" to the server:var val = new XMLHttpRequest(); val.open("POST", url, true); val.onload = function (event) { }; var blob = new Blob(['demo'], {type: 'text/plain'}); val.send(blob);

Working with Polygon Tag in HTML5

Lakshmi Srinivas
Updated on 29-Jan-2020 10:18:39

287 Views

You can try to run the following code to learn how to work with the tag in HTML5:                    #svgelem{             position: relative;             left: 50%;             -webkit-transform: translateX(-40%);             -ms-transform: translateX(-40%);             transform: translateX(-40%);          }             SVG                     HTML5 SVG Star                      

Advertisements