Archive for June, 2009

jQuery and urlencode / decode


Using jQuery and ajax can be tricky if you need to get urls with parameter in them.  You need to be smart when you pass a url so make sure to encode the url.

update: August 2010

Don’t use the plugin below. It is much better to use the native javascript functions: encodeURI or decodeURI.

var uri="your url.php?name=ståle&car=saab";
document.write(encodeURI(uri)+ "
");

which outputs:

your%20url.php?name=st%C3%A5le&car=saab

For more information on this please visit:
W3schools

Comparing escape(), encodeURI(), and encodeURIComponent()

Luckily there is a function / jQuery plugin to encode url’s and decode them if you like. Download the urlencoder plugin and then use it as shown below.

1st step encode your url:

	$("#con").html(
		$.URLEncode("This is only a test");
	);

2nd step decode your url

	$("#un").html(
		$.URLDecode("This%20is%20only%20a%20test");
	);

Pretty simple. It will save you a lot of headaches, if you are doing any json or ajax.

WordCamp Chicago


Wordcamp Chicago

Wordcamp Chicago

Made it to wordcamp chicago. It was one of the better seminars I have been to. Saw Matt, he was pretty funny and down to earth, which is nice with the open source croud.  WordPress MU and Buddypress look awesome. WordPress has come a long way since I last remember. That being said it still have a long way to go I think before it’s feels like a true cms. I want to use it for more business sites but I still like expression engine. I guess it’s just me.   Anyway check out more here at wordcampchicago. Got to meet Jeff from wptavern, cool guy and bunch of local chicago seo guru’s. Can’t wait to see what is in store next year. Hopefully some more tech tracks.

I am working on updates to this site also. Learning thematic a word press framework. It’s not as intutive as I thought it might be? It seems to have a big user base. So I will see how this turns out.  Do you have a favortie wordpress framework? Let me know.