Tag Archives: javascript

thickbox alternatives

While Thickbox had its day, it is not maintained any longer, so we recommend you use some alternatives. colorbox jQueryUI Dialog fancybox DOM window shadowbox.js

Posted in Web Development | Tagged , , | Leave a comment

greasemonkey – google images relinker (v 2.0)

I really like the google image relinker script for greasemonkey, but sometimes when there’s a hotlink protection or something else funky, you just want the original google images link. i updated this greasemonkey image re-linker script so that it relinks the images, but also provides links to open the original link (both in a new tab, and in a new window) Download the script: google_image_relinker_v2_00.user.js.txt (rename to just .js) google_image_relinker_v2_00.user.js (right click and save as) Greasemonkey scripts can be used with chrome or firefox

Posted in Web Development | Tagged , , , | 1 Comment

Fancy Thumbnail Hover Effect w/ jQuery

clipped from www.sohtanaka.com Recently I was checking out some nice flash galleries and came across an effect that I really liked. I had a sudden urge to duplicate that similar effect but using my bread and butter (CSS and jQuery). I thought I’d share this and maybe some of you can find it useful. View Demo

Posted in Design, Web Development | Tagged , | Leave a comment

Using json_encode() and json_decode() in PHP4

I use json_encode() a lot for AJAX calls. Teamed with jQuery’s $.getJSON(), it’s too convenient not to use. Unfortunately, json_encode() doesn’t come standard until PHP 5.2. To add insult to injury, many current *nix distros don’t include PHP 5.2 in their official repositories yet. So, if you’re using PHP4 download JSON’s json_encode and json_decode for PHP4 (which automatically degrade for PHP5, thus not breaking your app during an upgrade) here: http://mike.teczno.com/JSON/JSON.phps json_encode() example 1 <?php include("JSON.php"); $a = json_encode( array( ‘a’=>1, ‘2’=>2, ‘c’=>’I <3 JSON’ ) ); echo $a; // Outputs: {"a":1,"b":2,"c":"I <3 JSON"} $b = json_decode( $a ); echo "$b->a, $b->b, $b->c"; // Outputs: 1, 2, I <3 JSON json_encode() / json_decode() example 2 In Javascript, consuming input in JSON format is as easy as: eval(“var decoded_data = ” + encoded_data); With JSON-PHP, it can be almost as easy on the server-side, too: // create a new instance of Services_JSON require_once(‘JSON.php’); $json = new Services_JSON(); // convert a complex value to JSON notation $value = array(1, 2, ‘foo’); $output = $json->encode($value); print($output); // accept incoming POST data $input = $GLOBALS[‘HTTP_RAW_POST_DATA’]; $value = $json->decode($input); Using json_encode() and json_decode() in PHP4 with Arrays You can use json_encode() with arrays or multi-dimensional arrays. When you are ready to output it as json, just call echo json_encode($yourArray); You can also use this method with jQuery’s $.ajax call, and specify the data type as JSON, although jQuery will automatically try and detect the data type, so that may not even be necessary. source: mike.teczno

Posted in Web Development | Tagged , , | 10 Comments

jQuery speed in firefox vs chrome

so, everyone knows that Chrome is the fastest browser for running Javascript. But it is almost 4x as fast as FF2 for running jQuery UI elements. WOW!

Posted in Web Development | Tagged , , | 1 Comment