Raise the Mobile Safari HTML5 Application Cache Limit

Chandu yadav
Updated on 30-Jul-2019 22:30:22

679 Views

Application cache on Safari has no limit on storing data, but for mobile Safari the rues are different.The upper limit is 5MB.On mobile safari, the local storage and session storage are 5MB each. On WebSQL, a user is asked for permissions but you cannot store data any more than 50MB.With the latest iOS version, if a web app needs more then 5MB of cache storage, a user will be asked if it has permission to increase it. This is done so that the user can manage own memory space.

Display Video Inside HTML5 Canvas

Rishi Rathor
Updated on 30-Jul-2019 22:30:22

474 Views

You can try the following code snippet to display video inside HTML5 canvas.var canvas1 = document.getElementById('canvas'); var context = canvas1.getContext('2d'); var video = document.getElementById('video'); video.addEventListener('play', function () { var $this = this; (function loop() { if (!$this.paused && !$this.ended) { context.drawImage($this, 0, 0); setTimeout(loop, 1000 / 30); } })(); }, 0);

Escaping Single Quotes in JSON Encoded HTML5 Data Attributes

George John
Updated on 30-Jul-2019 22:30:22

4K+ Views

To escape single quotes, use json_encode() to echo arrays in HTML5 data attributes.printf('', htmlspecialchars(json_encode(array('html5', ...)), ENT_QUOTES, 'UTF-8'));Or you can also using built-injson_encode(array('html5', ...), JSON_HEX_APOS)

Check the Validity of Your CSS

karthikeya Boyini
Updated on 30-Jul-2019 22:30:22

118 Views

Validation is the process of checking something against a rule. When you are a beginner, it is very common that you will commit many mistakes in writing your CSS rules. How will you make sure whatever you have written is 100% accurate and up to the W3 quality standards?If you use CSS, your code needs to be correct. The improper code may cause unexpected results in how your page looks or functions.But if you want to validate your CSS style sheet embedded in an (X)HTML document, you should first check that the (X)HTML you use is valid.Tool to check the ... Read More

Java is Not Purely Object-Oriented Like C++

Pythonista
Updated on 30-Jul-2019 22:30:22

414 Views

the main() method in Java code is itself inside a class. The static keyword lets the main() method which is the entry point of execution without making an object but you need to write a class. In C++, main() is outside the class and writing class it self is not mandatory. Hence, C++ is not a pure object oriented language bu Java is a completely object oriented language.

Write String Functions in Java

Pythonista
Updated on 30-Jul-2019 22:30:22

140 Views

1) take a string from the user and check contains atleast one digit or not:Extract character array from string using toCharArray() method. Run a for loop over each character in array and test if it is a digit by static method isDigit() of character classpublic static boolean chkdigit(String str) { char arr[]=str.toCharArray(); for (char ch:arr) { if (Character.isDigit(ch)) { return true; } } return false; }2.) take ... Read More

Explain Python Operator Overloading

Jayashree
Updated on 30-Jul-2019 22:30:22

279 Views

Every class in Python, whether built-in or user defined is inherited from object class. The object class has a number of properties whose name is preceded and followed by double underscores (__). Each of these properties is a wrapper around a method of same name. Such methods are called special or magic methods.The magic methods __lt__(), __gt__(), __eq__(), __ne__(), etc. are overridden in a class to overload == and != operators respectively.

CSS Grid Rows

Rishi Rathor
Updated on 30-Jul-2019 22:30:22

135 Views

The horizontal line in the following is called Grid Rows.

CSS Grid Gaps

Arjun Thakur
Updated on 30-Jul-2019 22:30:22

129 Views

The space as shown in the following figure, between rows and columns are called Grid Gaps

Storing Credentials in Local Storage

Rishi Rathor
Updated on 30-Jul-2019 22:30:22

1K+ Views

The Local Storage is designed for storage that spans multiple windows and lasts beyond the current session. In particular, Web applications may wish to store megabytes of user data, such as entire user-authored documents or a user's mailbox, on the client side for performance reasons.For storing credentials in local storage, on successful login, generate a completely random string unrelated to user credentials. You need to store this in the database. Do not forget to add an expiry date. Pass that string to the JavaScript to be stored in local storage.As long as the local storage credential matches the database and ... Read More

Advertisements