Interactive by Nature

Remove Subdomain From URL With JavaScript

Saturday, April 9th, 2011

To remove a subdomain from the current URL in the browser is easier than you think. In my situation, I need to remove the mobile subdomian so that I can set a cookie that can be used on both versions of the website domain. i.e. mobile.sample.com and www.sample.com. I could have hardcoded the domain, but when you’re working with test and dev environments, it’s better to make it dynamic. Here’s what I came up with:

var separate = window.location.split('.');
separate.shift();
var currentdomain = separate.join('.');

(more…)

Posted in Code, Design, Development, jQuery, Mobile | 5 Comments »

jQuery Mobile Custom Icons

Monday, April 4th, 2011

Problem

It would be really nice if there was an easy way to create custom icons for jQuery Mobile. An ideal scenario, for me, would be to replace one of the un-needed icons in the provided icon set with my custom icon. Then, reference that icon by renaming the selector in the CSS. But, when I open the PNG, all the icons become jagged and pixelated. I’m not a Photoshop expert, so I could be doing something wrong. When opening icon-18-white.png in Photoshop, the files default color mode is Indexed Color. In order to edit this file, I need to change it. When I change the color mode, that’s when the icons degrade.

(more…)

Posted in Code, Design, Development, jQuery, Mobile | 16 Comments »