WEB


  Check mobile device using JavaScript

Sometimes developers want to know whether the user is using a mobile browser or a desktop browser so that they can build corresponding user experience. Although in many cases responsive web design would help solve component alignment issues, there are performance related considerations in some cases where some code should not be ran or some feature should not be available if user is on mobile browser. or vice versa This post will summarize a few ways which are commonly used to check whether a user is on mobile device or not.navigator.userAgentThe straightforward approach is to parse the user a...

3,883 0       JAVASCRIPT MOBILE DEVICE MOBILE BROWSER CHECK


  Install and enable redis extension in PHP 5.X on Windows

Redis is frequently used as a caching layer for web applications to improve its performance. In PHP 5.x, if one wants to use Redis, the redis extension needs to be installed and enabled first.This post will show how to install and enable redis extension on Windows with PHP 5.X. Basically there are two dlls to be downloaded: php_redis.dll and php_igbinary.dll.Below are detailed stepsGo to http://windows.php.net/downloads/pecl/releases/redis/2.2.7/ and find the respective php_redis zip matching your environment.Go to windows.php.net - /downloads/pecl/releases/igbinary/2.0.1/ and f...

5,462 4       PHP 5.6 WINDOWS REDIS PHP


  Privileged users get removed from database in GoDaddy shared hosting

GaDaddy is a famous web hosting platform where many people put their websites on its platform. If one has low budget and wanna a shared hosting, you can buy the service at GoDaddy and share some hosting resource with others. In such cases, there would be resource limit based on different plans.In this post, we will discuss one scenario which caused our application down caused by database usage on shared hosting plan and hope it helps readers who encounter similar issues.The issue we encountered is that our privileged users associated with the database we created get removed all of a sudden and...

1,926 0       CPANEL DATABASE GODADDY PRIVILEGED USER


  Load html content properly in iframe

When loading content in an ifrasme, there are normally two ways: loading with src or creating iframe dynamically and set content dynamically. In this post, we will talk about how to properly load content in a dynamically created iframe element, especially on how to fix some issue we faced while in Firefox.To create an iframe dynamically, we would normally use JavaScript and with below piece of cod:let iframe = document.createElement("ifrasme");iframe.innerHTML = "this is some text";document.getElementById("content_zone").appendChild(iframe);Once this is ran, an iframe element with html will be...

1,886 0       HTML IFRAME BLANK FIREFOX FIX


  Example on integrating TypeScript with Webpack

TypeScript is now a very popular language to create typed JavaScript code to reduce development error. It provides a type system on top of JavaScript which has only a weak type system. Once the TypeScript code is developed, it can be compiled into corresponding JavaScript so that they can be loaded and parsed by browser.Webpack is another tool for bundling multiple JS files into a single one so that no multiple connections to be established between browser and server. when a page is loaded This would reduce the bandwidth consumption and improve website performance in general.These two are good...

2,765 0       WEBPACK TYPESCRIPT JAVASCRIPT EXAMPLE


  Five Copyright Pitfalls Every Web Designer Should Avoid

If you work in the world of web design, it is crucial you do not infringe upon copyright laws. If you do, you could end up paying some hefty fines or even being prosecuted. So, check out these five common copyright pitfalls you need to avoid.Not Copyrighting Your Own WorkWhile most copyright infringement pitfalls web designers face are to do with avoiding using copyrighted materials, you also need to know how to protect your own work to ensure no one else steals it. For things like patents, trademarks, intellectual property litigation, and copyright, check out how Heer Law can help you to stay...

4,928 0       COPYRIGHT WEB DESIGN PATENT


  Using JavaScript to operate clipboard

Browsers allow JavaScript to read and write data on clipboard. Generally script should not modify user's clipboard to avoid impacting user expectation, but there are cases where this can indeed bring convenience to users. For example, for some code snippet, user can copy it to clipboard with one click instead of select and copy manually.There are three options for clipboard operation provided in JavaScript/browser:document.execCommand()Asynchronous Clipboard APIcopy and paste eventsThis post will briefly talk about these three options.document.execCommand()This is the early option for operatin...

3,355 0       JAVASCRIPT CLIPBOARD NAVIGATOR.CLIPBOARD


  Ways to check existence of JavaScript object

The design of JavaScript is not so sophisticated. It's very easy for us to make mistakes if we are not very careful when using JavaScript. For example, to check the existence of JavaScript object.Now we want to check whether a global object myObj exists or not, if it doesn't exist, we declare it. The pseudo code for this is :if(myObj not exist){ declare myObj;}You may think it's very easy to write the code. In fact, it is much more difficult than we may think. Juriy Zaytsev says there are more than 50 ways to check whether a JavaScript object exist or not. Only if you are very clear about the ...

55,034 1       JAVASCRIPT OBJECT EXISTENCE