News & Blog

Remove the Scrollbar in Fullscreen Mode when Using JavaScript

October 26th, 2010 - Posted by Steve Marks to (X)HTML / CSS, Javascript / jQuery, Web Development.
By using the window.open() function of JavaScript we can popup a new browser window/tab, specify the height and width of the window to be opened, and even set whether to hide or show certain elements such as toolbars, the address bar and more. One of the other attributes we can specify is ...

How to Check if jQuery’s ColorBox is Open or Closed

October 20th, 2010 - Posted by Steve Marks to Javascript / jQuery, Web Development.
jQuery’s ColorBox is one of my favourite and most used jQuery plugins. It’s simple to set up, looks great, very customisable and the website contains examples to cover every scenario you could imagine. One thing that I couldn’t achieve right away however was how to get th...

Removing All Spaces From a String Using Javascript

October 20th, 2010 - Posted by Steve Marks to Javascript / jQuery, Web Development.
I recently wrote about how to remove all occurences of a character from a string using JavaScript by combining the replace() function and a regular expression. This works great but a problem arises when we use this method to try and replace all occurrences of a space. Using the previously ...

How to Create and Add a Favicon to your Website

October 14th, 2010 - Posted by Steve Marks to Web Development.
Favicons (meaning favourites icons) are small images that appear in the address bar, a browser tab or a bookmark when someone visits your site. They add branding and uniqueness to any website and are so simple to setup taking just minutes to generate. I want to show you just how easy they ...

Passing an Optional Variable to a JavaScript Function

October 13th, 2010 - Posted by Steve Marks to Javascript / jQuery, Web Development.
Ever needed to call a function expecting parameters but use the functions default value rather than passing the same value each time? Let me give you an example: function do_something(my_var) { alert(my_var); } do_something(); In doing the above you will get ‘undefined’ output....

Removing Mysterious Blank Space from Above a Table in IE7

October 11th, 2010 - Posted by Steve Marks to (X)HTML / CSS, Web Development.
I know, I know… HTML tables are old school, out of date and uncool. Regardless of this fact however they will always be used on some sites and admittedly, I even use them myself in certain circumstances. I came across an issue recently however when cross-browser testing a page where ...

CodeIgniter Labels Library

October 11th, 2010 - Posted by Steve Marks to PHP, Web Development.
Generating labels on the web via an application is something I’ve come across numerous times in my career and never have I been able to find a reliable and versatile enough method for doing so. As a result I generated a library for the PHP framework CodeIgniter to handle the hundreds...

Get the Current Season Using PHP

October 4th, 2010 - Posted by Steve Marks to PHP, Web Development.
The PHP date() function is great for the majority of tasks regarding getting a date or time, however one thing it doesn’t cater for is obtaining the season. Seasons generally vary depending on the year and where you’re based in the world; While it’s Summer in the Northern...

Get a List of Dates Between Two Dates with PHP

October 3rd, 2010 - Posted by Steve Marks to PHP, Web Development.
When building an events calendar recently I needed to obtain all the dates between two dates. For others looking to do the same thing I used the code below to achieve this. Simply change the $date_from and $date_to variables to get it working for you. // Specify the start date. This date c...

JavaScripts replace() Function Only Replacing First Occurrence

October 3rd, 2010 - Posted by Steve Marks to Web Development.
The replace() function in JavaScript is useful for finding a substring within a string and replacing it with a new substring. What the official JavaScript documentation doesn’t state very clearly however is that the function will only replace the first occurrence. But what if we need...