Categories

How to use JavaScript to detect mobile and hand held devices

Share

If you are maintaining separate web pages on your website for visitors viewing your website on their mobile phones or hand held devies then you can use the following JavaScript code to check the visitor’s user agent and direct them to the relevant web pages.

<script type=”text/javascript”>

var mobile = function(){ return { [...]

How to use CKEditor in your web page using JavaScript

Share

CKEditor has replaced its older version FCKEditor with more features and browser compatibility with latest versions of Firefox and Chrome. It’s also more secure than FCKEditor which has been exploited by hackers.

Use the following code to instantiate the CKEditor on a web page

<script type=”text/javascript” src=”http://www.google.com/jsapi”></script> <script type=”text/javascript”>if (typeof jQuery == ‘undefined’) [...]

How to display current date and time on a webpage using JavaScript

Share

I make a habit of displaying the current date and time on website backoffice panels I develop for clients. The reason being that time is money for clients and they need to always know the time so they can manage it better and prioritize their work accordingly. I use JavaScript to display the date [...]