Make your Firefox better - 10 Useful Addons
Google Chrome is the hottest topic these days. It’s fast but Firefox is still my first choice since they have lots of extensions, add-ons to enrich the features. And you can’t really live without them.
- Firebug - the must have addon for developers, the famous debugging tool
- Clear Cache Button - a very simple add-on that give you an easy way to clear your cache
- Delicious Bookmarks - the best bookmark service to replace firefox’s bookmark feature, especially you’re using multiple computers
- Download Statusbar - just like the download bar of Google Chrome but this addon released for years.
- GooglePreview - this make your google search result better, it provides a thumbnail for each search result
- Fission - do you like safari progress bar? this addon turns your firefox address bar displaying the progress like the safari one, nice
- Linkification - turn all your text url clickable, simple but very useful
- Web Developer - another must have addon for developers
- Locationbar - another Google Chrome like feature but this one even better, puts emphasis on the domain and linkifies the URL
- Auto Dial - Google Chrome feature again, display your most visited website in the new tab
Simple Ajax based on Prototype Framework
Prototype is one of the most commonly used ajax framework in web2.0. Here is a very simple example to make a ajax page loading in the HTML.
First, you need to have the prototype framework, you can download here, or you can use the included one in the example zip file.
I wrapped the ajax page loading function in a javascript function, so we can reuse this function more easily, here is the javascript code:
function loadPage(pageURL, displayID, queryStr) {
var url = encodeURIComponent(pageURL);
var params = '';
if (queryStr != undefined)
params = queryStr;
new Ajax.Request(url, {
method: 'get', parameters: params,
onSuccess: function(transport) {
if(transport.responseText.length > 0){
document.getElementById(displayID).innerHTML=transport.responseText;
}}});
}
You need to pass 3 parameters for this function:
- pageURL - the page url which you want to load, without the HTML and BODY tag
- displayID - the div id which the result will be displayed
- queryStr - name and value pair for dynamic page, which is optional
And you need to define the display div in the HTML as follow:
<div id="display_body"> </div><br />
Now, you can simply use this javascript to load a page by ajax:
<a href="javascript:loadPage('hello-world.html', 'display_body')">Load Hello World Page</a>
And here is the example source in zip format:
Download Here
Feel free to give any comments for us, thanks.
6 must-have Wordpress plugins
Wordpress blog is very popular nowaday, we use wordpress in this development blog. We would like to introduce some must-have plugin for wordpress which make our job easier.
Here is a list of plugins:
- All in One SEO pack - help you do all SEO for your blog, like generate all title and meta tag automatically for you.
- Google Analyticator - everyone use Google Analytics now, this plugin make us more easy to use it on your wordpress.
- Google XML Sitemaps - another great tool to help you generate sitemap which help search engine to better understand your site.
- Sociable - one plugin for all social bookmarking sites, enable user to submit your posts or pages to their favourite bookmark.
- Similar Posts - display similar posts in your sidebar, you need to have Post-Plugin Library installed
- wp-cache - cache your dynamic posts or pages, make wordpress more efficent in loading, you may try to use wp-super-cache
Please let me know if you have more plugin to introduce to others, thanks.
Enjoy your wordpress blog.
Get your Sign Up Referer by PHP
Thanks to Google Analytics that help us on website traffic tracking. But for some reason we still need to track some specific statistics, like the referer of the user when user do a specific action, for a example, sign up on your website.
By using session in PHP, we can easily get the referer no matter which page the user is coming. Here is the PHP source code:
session_start();
if (empty($_SESSION[_referer'])) {
$host = parse_url($_SERVER['HTTP_REFERER'],PHP_URL_HOST);
if (empty($host)) {
$_SESSION['_referer'] = 'DIRECT';
} else {
$_SESSION['_referer'] = $host;
}
}
$referer = $_SESSION['_referer'];
And we can store the referer in the database or other tracking suit if we need.
You can download the php file and simply include it in your php header.
How to use:
1. Download the php source file and rename to .php extension
2. Include the php file in your php source or in your generic header file
3. Now you can just use the $referer to get the referer host information
include '/path/to/referer.php'; echo $referer;
Enjoy!






