Lakshmi Srinivas has Published 287 Articles

Do we have any other statement in MySQL instead of SHOW COLUMNS to get the list of columns in an existing table?

Lakshmi Srinivas

Lakshmi Srinivas

Updated on 29-Jan-2020 05:12:52

114 Views

Yes, we can use DESCRIBE or EXPLAIN statements instead of SHOW COLUMNS statement to get the list of the columns in an existing table. In the example below we have applied DESCRIBE and EXPLAIN statement on ‘Employee’ table and got the same result set as got after SHOW COLUMNS statement ... Read More

Unable to take a photo from webcam using HTML5 and on the first page load

Lakshmi Srinivas

Lakshmi Srinivas

Updated on 28-Jan-2020 10:32:55

251 Views

You need to try the following to take photo from webcam using HTML5:Declare variablesvar streaming = false,    video = document.querySelector('#video'), canvas = document.querySelector('#canvas'),    photo = document.querySelector('#photo'),    startbutton = document.querySelector('#startbutton'),    width = 320,    height = 0;Using getUserMedianavigator.getMedia = ( navigator.getUserMedia ||           ... Read More

HTML5 audio control stop button

Lakshmi Srinivas

Lakshmi Srinivas

Updated on 28-Jan-2020 10:20:06

1K+ Views

Try the following code to add a stop button to your audio in HTML5:function displayStopBtn() {    var myPlayer = document.getElementsByTagName('audio')[0];    myPlayer.pause();    myPlayer.currentTime = 0; }You can also include jQuery:$("#stopButton").click(function () {    audio.pause();    audio.currentTime = 0; });

Full page drag and drop files website with HTML

Lakshmi Srinivas

Lakshmi Srinivas

Updated on 28-Jan-2020 10:18:14

415 Views

For full page drag and drop files, try the following code:var myDrop = document.getElementById('dropZone'); function displayDropZone() {    myDrop.style.visibility = "visible"; } function hideDropZone() {    myDrop.style.visibility = "hidden"; } function allowDrag(ev) {    if (true) {       ev.dataTransfer.dropEffect = 'copy';       ev.preventDefault();    } } ... Read More

Move an HTML div in a curved path

Lakshmi Srinivas

Lakshmi Srinivas

Updated on 28-Jan-2020 10:03:41

351 Views

To move an HTML div in a curved path, use any of the following: CSS Transitions JavaScript (jQuery) HTML5 CanvasTry JavaScript to make it work in every browser.Use the animate() method. The animate() method performs a custom animation of a set of CSS properties.The following is the syntax:selector.animate( params, [duration, easing, callback] );Here ... Read More

Any ideas on how to prepare for the future of Flash/ Flex/ HTML5 Development?

Lakshmi Srinivas

Lakshmi Srinivas

Updated on 28-Jan-2020 10:01:21

105 Views

In future, in the same like today, if any user still wants to use Flash they will have to enable Flash manually.HTML5 and Flex is the future.HTML5 is a cooperation between the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG). The latest versions of Apple ... Read More

Load image from url and draw to HTML5 Canvas

Lakshmi Srinivas

Lakshmi Srinivas

Updated on 28-Jan-2020 09:19:27

4K+ Views

You need to create an image object in JavaScript after that set the src.However, you need to wait for the load event before drawing.The following is the canvas:var canvas = document.getElementById("myCanvas"); var context = canvas.getContext("2d"); var myImg = new Image(); img.onload = function() {    context.drawImage(myImg, 0, 0); }; ... Read More

HTML5

Lakshmi Srinivas

Lakshmi Srinivas

Updated on 28-Jan-2020 08:31:19

620 Views

Use Mediaplayer of Android for playing audio. You need to call function of Android from JavaScript that you have written in HTML file.WebView wv = (WebView) findViewById(R.id.webview); wv.addJavascriptInterface(new WebAppInterface(this), "Android"); public class WebAppInterface {    Context mContext;    WebAppInterface(Context c) {       mContext = c;    } ... Read More

What is getContext in HTML5 Canvas?

Lakshmi Srinivas

Lakshmi Srinivas

Updated on 28-Jan-2020 08:30:13

1K+ Views

The canvas element has a DOM method called getContext, used to obtain the rendering context and its drawing functions. This function takes one parameter, the type of context 2d.Following is the code to get required context along with a check if your browser supports element:var canvas = document.getElementById("mycanvas"); if ... Read More

Is there any way to embed a PDF file into an HTML5 page?

Lakshmi Srinivas

Lakshmi Srinivas

Updated on 27-Jan-2020 08:04:10

721 Views

To embed a PDF file in an HTML5 page, use the element.           HTML iframe Tag               HTML5 Tutorial          

Advertisements