Posts Tagged ‘jquery’

Geocaching Hint Encoder/Deocder

0

So, I wrote this little thing a couple days ago. I was browsing on Geocaching.com and wanted to decode some of the hints. I found a few ROT13 decoders online, but wanted to write one of my own.

Much to my dismay, I learned geocaching.com has a built-in “decode” link right next to the encoded hints. I didn’t learn about this until about 10 minutes after I had finished writing the Geocaching Hint Encoder/Decoder. Thankfully, I didn’t have more than 20 minutes of work into it, so no big deal.

Geocaching Hint Encoder/Decoder was made with PHP and jQuery. I even put all the code up on Github so you can have a look for yourself!


Use Google Hosted jQuery in WordPress

0

So, I recently needed to use a google hosted version of jquery for a WordPress theme (don’t ask). I came across this topic at the WordPress forums.

User bazil749 suggested doing this, I’ve updated it to include jQuery 1.4.4:


<?php
if( !is_admin()){
	wp_deregister_script('jquery');
	wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"), false, '1.4.4');
	wp_enqueue_script('jquery');
}
?>

I added that piece of code to the proper place in the header.php file for the theme and it worked like a champ. jQuery was now loading from Google. The Use Google Libraries plugin does the same basic thing, except it can use libraries other than just jQuery, like jQuery UI, Dojo, MooTools, and Protoype.

There are a number of good reasons to let Google host jQuery for you.


Post navigation