Javascript Copy and Paste

In a previous tutorial we saw how you can create a copy and paste button using jQuery and the ZeroClipboard flash extension. The problem with this is that it requires flash. As most of the web is mov...

Moving To Javascript Development

Over the last couple of years there's been a growing trend in web development, this is the moving away from traditional back-end development and more to front-end development using Javascript. This ha...

Javascript Check For Daylight Saving

Trying to work out the correct DateTime offset of a visitor can be tricky, the easiest way of doing this would be with JavaScript. You can find out the visitors DateTime information by using the JavaS...

Back To Top Pure JavaScript

A popular trend you see on many websites is the back to top button, where the user will click this button to automatically scroll back to the top of the page. In a previous tutorial I exampled how you...

How To Capitalize The First Letter Of A String In JavaScript

Here is a quick code snippet for the JavaScript version of ucfirst. This code snippet will allow you to capitalize the first letter of a string using JavaScript. <br></br> function jsUcfir...

Fixed Width Sortable Tables Row With jQueryUI

When you use jQuery UI sortable function on a table I've noticed that it will collapse the width of the row you're dragging which can lead to a strange user experience. In this tutorial we are going t...

Checking Media Queries With Javascript

With the web being used on so many different devices now it's very important that you can change your design to fit on different screen sizes. The best way of changing your display depending on screen...

Make JW Player Responsive

The following article will show a code snippet of how you can use the third party application JWplayer on your website to display videos and an easy way of how you can make these videos responsive. JW...

Re-render Prism.js On New Code

I recently switched to use a new syntax highlighter called Prism.js, unlike other highlighters Prism.js is extremely lightweight by default and you can append additional add-ons to library for more op...

Disable Scroll Wheel Zoom On Google Maps

When you are using the Google map API on your website it will override the the scroll mouse event and act as the zoom on the maps. This feature makes it really easy to zoom on a certain position on t...

Detect IPhone, IPad or IPod

With mobile devices becoming more and more popular there will be times when you need to do something different for users coming to your site from one of these mobile devices. If you want to change the...

How To Display A Message If Javascript Is Turned Off

Having an accessible website is very important it means that you are not neglecting any potential customers coming on to your site and being able to use it correctly. But what do you do when the visi...

How To Check Number Is Odd Or Even

Here is a quick little snippet which can prove to be quite useful. This snippet will check to see if a number is odd or even. ## In Javascript function checkEven(val){ return (val%2 == 0); } v...

Get Url Sections In Javascript

Even though most of the time to get information from the page URL you will use the server side programming language, you can actually use Javascript to get the different sections that make up the URL...

How To Make Random Hex Colour In Javascript

In this tutorial you will learn how to create random colours using Javascript. To create a random colour in Javascript it is a simple function. function random_colour(){ return Math.floor(M...