Blog Category • JavaScript

Get the Epoch Time in JavaScript

It is very simple to get an epoch time in Javascript. Javascript’s date object has a method named valueOf, which returns the number of microseconds since January 1, 1970 UTC. This isn’t exactly what we want though, because we intend to have a value in seconds and not microseconds. Fortunately, we can just divide by 1000, then remove the floating point by rounding.

Read More …

Posted February 7th, 2014 in

Change FlexSlider Slides The Easy Way

Responsive Web Design SlideshowFinding a slideshow plugin for jQuery might seem like it’s going to be an easy task, but it takes time to review them, and there are a few things to consider. Since I’ve been working with responsive web design lately, a slideshow plugin’s ability to scale with the rest of the design is very important. There are other factors to consider though, and in the end I chose FlexSlider by WooThemes.

Read More …

Posted February 7th, 2014 in ,

Google Maps Variables Replaced Feb 2013

One of the projects I have going right now requires using the Google Maps API. One of the features of this API allows for sending a street address to Google and receiving a response that includes GPS coordinates at that location. Today, when I needed to use my map, it was broken! Looking in my console I found that the variables I was getting my Latitude and Longitude values from were missing, and replaced with new variables. Google has probably suggested that developers not use the variables, instead using some functions to get the desired values, but I must have skipped that part of the documentation.

Read More …

Posted February 7th, 2014 in ,

Responsive Breakpoints for jQuery

Lately I’ve been working with a lot of responsive web designs, and this type of work is obviously related to CSS, but like any front-end work, javascript (in this case jQuery) is always in the mix. I wouldn’t call it challenging, but I had to come up with a solution to inform jQuery of what screen width breakpoint the responsive design was displaying.

Since we have the ability to change the styling of an element at each breakpoint in our designs, we can simply apply a different value for a specific CSS rule at each breakpoint. In the case of the latest design I’ve been working on, I chose to change the text color of some text that that was being hidden by an image replacement.

Read More …

Posted February 7th, 2014 in ,

jQuery Character Restriction Plugin

There are many ways to handle client side validation of form input, and I’ve come up with my own solution. Part of my solution includes a character restriction plugin I created using jQuery. The plugin checks specified text input and textarea elements as someone types in them, and removes characters that are not allowed.

Read More …

Posted February 7th, 2014 in ,

jQuery Password Toggle Plugin

Password ToggleHave you ever had to sign in to a website, and wanted to be able to see the password as you type it? Maybe you don’t have Mr. Evil looking over your shoulder, and seeing your password would help you know if you had typed it in correctly. I had seen such functionality on a website in the past, and this week I decided to create a jQuery plugin for use on my customer’s websites. I actually searched the internet for such a plugin, and came across a few, but for various reasons decided they were not right for me. With help from some of the forum members at SitePoint, I came up with a solution that worked in all modern browsers, and met my needs. Feel free to download the plugin and use it. The plugin works in the latest versions of Firefox, Chrome, Opera, Safari, and Internet Explorer, as well as Internet Explorer 7 and Internet Explorer 8 (Sorry, I didn’t check IE6).

Read More …

Posted February 7th, 2014 in ,