Found 2418 Articles for HTML

Menu not visible in IE8. How to make it visible with HTML?

Lakshmi Srinivas
Updated on 04-Mar-2020 06:22:09

69 Views

One of the divs, when placed in another style sheet, can make menu invisible in Internet Explorer.If opacity property is used which is not a cross-border solution, it should be like the following to display −opaque {      -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; // first      filter: alpha(opacity=90);  // second }

How do I get an address latitude-longitude using HTML5 Geolocation or Google API?

karthikeya Boyini
Updated on 04-Mar-2020 06:20:17

381 Views

In order to get latitude and longitude using an HTML5 Geolocation or any Google API, we need to add JavaScript for this. The script is as follows −if (navigator.geolocation) {    /*  If current position is obtained then there is success otherwise there is failure.    On failure, separate error message is shown  */        navigator.geolocation.getCurrentPosition(successFunc, errorFunc); }  else {        alert(‘Geolocation is not enabled in your browser. Please use a latest browser to supports it.'); }

HTML5 semantic elements and which old browsers does it support?

Ankith Reddy
Updated on 04-Mar-2020 06:19:30

203 Views

Internet Explorer 8 and older versions does not support semantic elements like nav, header and article. To style semantic elements, Modernizer is used. Some CSS can be added to block CSS by default.article, header, nav, section, footer {    display:block; }We can also create our own elements through JavaScript by writing following code −    document.createElement('nav'); //nav is semantic element    document.createElement('header'); //header is semantic element    document.createElement('article'); //article is semantic element

Upload from local drive to local filesystem in HTML with Filesystem API

vanithasree
Updated on 24-Jun-2020 14:09:06

154 Views

To upload from local drive to the local file system, we can use −Webkitdirectory attribute on − This allows the user to select a directory by the appropriate dialog box.Filesystem API is a sandboxed filesystem, which allows us to store files on client’s machine.File API allows us to read files. Files are accessible by elementAll of the above is working fine in Google Chrome.WebKit directory is a much better option among these. Use the following for directory −webkitRequestFileSystem(    window.TEMPORARY, 5 * 1024 * 1024, function(_fs) {       fs = _fs;    }, ErrAbove, err and fs are −var fs, err = function(err) {    throw err; };

Mouse event not being triggered on HTML5 canvas? How to solve it?

Arjun Thakur
Updated on 24-Jun-2020 14:09:51

359 Views

To trigger mouse event we can add −-webkit-transform: translate3d(0, 0, 0)In addition to this canvas can also be styled.Another way is to add a listener in the event mousemove,canvas.addEventListener("mousemove", this.checkMouseLocation.bind(this, this.inputs), false);By adding this listener, we can easily trigger a mouse move event in HTML5.

How does mobile safari determine when to prompt the user to share location in HTML?

Samual Sam
Updated on 24-Jun-2020 14:10:27

88 Views

When we have a requirement in which we want to track the latest locations for a user only when they are in a certain area, then we write separate code for it. The code to determine when to prompt the user to share location in HTML is as follows -if (frstTime) { //First time        navigator.getCurrentPosition(function (coordinates) {             if (coordsAreInTheBox) {                    storeCoordsForUser();                    navigator.watchPosition();             }        }); ... Read More

Splitting up an HTML page and loading it through header?

seetha
Updated on 24-Jun-2020 14:11:05

131 Views

In order to speed up creation and edition of HTML, splitting of HTML files are required into three separate HTML files −HeaderFooterContentThis is not possible in a static Html website; however, this is possible through PHP. Another way is to use JavaScript to load page pieces after the main page is already loaded.

EventSource vs. wrapped WebSocket with HTML5 Server-Side Event

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 security models they used.Server Send events are useful for −Live Feeds Live Scores Stock Market Update

Can we delete the “getContext” property of HTML5 Canvas tag through script?

Prabhas
Updated on 02-Jun-2020 08:12:21

80 Views

There is no description in HTML5 specification, which says deletion of a getContext property by the script is valid.We can write a code in which we delete getContext property of HTMLCanvasElement and then in the separate statement we make it undefined.Delete window.HTMLCanvasElement.prototype.getContext; _assertSame(window.HTMLCanvasElement.prototype.getContext, undefined,    "window.HTMLCanvasElement.prototype.getContext", "undefined");

Pull down to refresh on the mobile web browser in HTML.

Lakshmi Srinivas
Updated on 24-Jun-2020 14:12:20

700 Views

When there is a requirement to pull down the screen to refresh the page to get latest updates, this can be done with the help of JavaScript, xhttprequests and then touch events.Pull refresh is a trigger to XHR in AJAX .It adds new data to the element we want.Pull refresh can be implemented with the help of hijacked JavaScript scrolling mechanism like iscroll. Twitter is using iscroll to pull refresh option.Another way is to create a refresh handler for overflow:scroll components.The interface provided can give an idea about the handler interface −var PullToRefresh= function(callback, wrapper, instructionsText) {    //It ... Read More

Advertisements