Affichage des articles dont le libellé est Snippets. Afficher tous les articles
Affichage des articles dont le libellé est Snippets. Afficher tous les articles

samedi 12 novembre 2016

25 handy code snippets for WordPress Developers



alt="25 handy code snippets for WordPress Developers" src="http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/01/web-server-data-500x202_c.jpg" />

class="border" alt="WordPress Code Snippets" src="http://www.webhostingsecretrevealed.net/images/2011/1010-3.jpg" width="750" />

WordPress has become one of the largest and most customizable content management systems available today. As a result there is a high demand for href="http://www.webhostingsecretrevealed.net/blog/blogging-tips/25-most-wanted-wordpress-tips-tricks-and-hacks/">custom WordPress themes and hacks.

Below is a list of 25 handy code snippets that WordPress developers should know about, this list is in no particular order.

Display Your Most Popular Post

This code snippet will displays your most popular post based on number of comments. This snippet can easily be added to any theme.

<ul>
<?php $result = $wpdb->get_results(“SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 5″);
foreach ($result as $post) {
setup_postdata($post);
$postid = $post->ID;
$title = $post->post_title;
$commentcount = $post->comment_count;
if ($commentcount != 0) { ?>
<li><a href=”<?php echo get_permalink($postid); ?>” title=”<?php echo $title ?>”>
<?php echo $title ?></a> {<?php echo $commentcount ?>}</li>
<?php } } ?>
</ul>

Get Your Viewers Real IP Address

This snippet gets your user’s real IP address and returns it (even if they are on proxy server), allowing you to call on the function at later.

function getRealIpAddr()
{
if (!emptyempty($_SERVER[‘HTTP_CLIENT_IP’]))
{
$ip=$_SERVER[‘HTTP_CLIENT_IP’];
}
elseif (!emptyempty($_SERVER[‘HTTP_X_FORWARDED_FOR’]))
//to check ip is pass from proxy
{
$ip=$_SERVER[‘HTTP_X_FORWARDED_FOR’];
}
else
{
$ip=$_SERVER[‘REMOTE_ADDR’];
}
return $ip;
}

Unzip a File

This one allows you to unzip a file on your server. This snippet is a very useful one if you allow users to upload files.

/**********************
*@file – path to zip file
*@destination – destination directory for unzipped files
*/
function unzip_file($file, $destination){
// create object
$zip = new ZipArchive() ;
// open archive
if ($zip->open($file) !== TRUE) {
die (’Could not open archive’);
}
// extract contents to destination directory
$zip->extractTo($destination);
// close archive
$zip->close();
echo ‘Archive extracted to directory’;
}

Add http to a URL

This code adds the “http” to the beginning of a URL if it is not there.

if (!preg_match(“/^(http|ftp):/”, $_POST[‘url’])) {
$_POST[‘url’] = ‘http://’.$_POST[‘url’];
}

Show Breadcrumbs

This code snippet displays breadcrumbs in this format; Home / Post Category / Title.

<?php bloginfo(‘home’); ?> / <?php the_category(); ?> / <?php the_title(); ?>

Change Your WordPress Login Logo

Looking at the same logo every time you log into a WordPress website gets old quick. This snippet allows you to change the WordPress logo to anything you want.

It should be placed in your functions.php file.

function my_custom_login_logo() {
echo ‘<style type=”text/css”>
h1 a { background-image:url(‘.get_bloginfo(‘template_directory’).’/images/custom-login-logo.gif) !important; }
</style>’;
}
add_action(‘login_head’, ‘my_custom_login_logo’);

Allow Only Designated IP Address to Access wp-admin Directory

If you are concerned with your blog security then this snippet is perfect for you. Copy the code below to your .htaccess, replace “allow from xx.xxx.xx.xxx” to each IP address you want, and you’ll limit the access to your WP-Admin directory (only added IPs will be allowed).

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName “Example Access Control”
AuthType Basic
<LIMIT GET>
order deny,allow
deny from all
allow from xx.xx.xx.xx
</LIMIT>

Display Most Popular Post of any Timeframe

This snippet allows you to search for the most popular post during a specific timeframe. You will need to change the dates you are searching through manually.

<ul>
<?php
$result = $wpdb->get_results(“SELECT comment_count,ID,post_title, post_date FROM $wpdb->posts WHERE post_date BETWEEN ‘2009-01-01’ AND ‘2009-12-31’ ORDER BY comment_count DESC LIMIT 0 , 10”);
foreach ($result as $topten) {
$postid = $topten->ID;
$title = $topten->post_title;
$commentcount = $topten->comment_count;
if ($commentcount != 0) {
?>
<li></li>
<?php }
}
?>
</ul>

Added Author Bio to Each Post

This snippet allows you to give your authors the credit they deserve. This snippet will work with any theme that has an author section. The code snippet should be inserted into the functions.php file.

function get_author_bio ($content=”){
global $post;

$post_author_name=get_the_author_meta(“display_name”);
$post_author_description=get_the_author_meta(“description”);
$html=”<div class=’clearfix’ id=’about_author’>
“;
$html.=”<img width=’80’ height=’80’ class=’avatar’ src=’http://www.gravatar.com/avatar.php?gravatar_id=”.md5(get_the_author_email()). “&default=”.urlencode($GLOBALS[‘defaultgravatar’]).”&size=80&r=PG’ alt=’PG’/>
“;
$html.=”<div class=’author_text’>
“;
$html.=”<h4>Author: “.$post_author_name.”</h4>
“;
$html.= $post_author_description.”
“;
$html.=”</div>
“;
$html.=”<div class=’clear’></div>
“;
$content .= $html;
}

return $content;
}

add_filter(‘the_content’, ‘get_author_bio’);

Increase Memory Limit

By default the PHP memory limit for WordPress is 32MB, this may not be enough if you have a lot of traffic or plugins. This snippet allows you to change that limit to what you need. The code should be put into the wp-config.php .

define(’WP_MEMORY_LIMIT’, ’64M’);

Change Your Login URL

This snippet allows you to change your login URL to whatever you want. This can be used for both convenience and security. The code should be placed in the htacess file.

RewriteRule ^login$ http://yoursite.com/wp-login.php [NC,L]

Change Autosave Time Limit

This snippet allows you to change your autosave time limit for posts. The code should be added to the functions.php file.

# Autosave interval set to 5 Minutes #
define(‘AUTOSAVE_INTERVAL’, 300);

Remove Update Notice

If you are currently being bothered by the update message and don’t actually want to update your theme you should use this snippet, it will remove the message for you.

add_action(‘admin_menu’,’wp_hide_update’);
function wp_hide_update() {
remove_action( ‘admin_notices’, ‘update_nag’, 3 );
}

Add a Search Box in Your Navigation Bar

This snippet will allow you to add a search box in your navigation bar. The code should go in the functions.php file.

add_filter(‘wp_nav_menu_items’,’add_search_box’, 10, 2);
function add_search_box($items, $args) {
ob_start();
get_search_form();
$searchform = ob_get_contents();
ob_end_clean();
$items .= ‘<li>’ . $searchform . ‘</li>’;
return $items;
}

Add Google Analytics Tracking With no Theme Edits

Adding this snippet to your functions.php file will place you tracking code on every page that is generated dynamically. Sure you can use a plug-in to do this but you’re taking a chance of slowing down your site.

<?php add_action(‘wp_footer’, ‘ga_custom’);
function ga_custom() { ?>
// add google analytics code here!
<?php } ?>

Set Minimum Word Count on Posts

This snippet will allow you require all posts to be a minimum word count of whatever you choose. The snippet should go in the functions.php file.

function minWord($content) {
global $post;
$num = 100; //set this to the minimum number of words
$content = $post->post_content;
if (str_word_count($content) < $num)
wp_die( __(‘Error: your post is below the minimum word count.’) ); }
add_action(‘publish_post’, ‘minWord’);

Split Post Trackbacks and Comments

By default WordPress combines trackbacks and comments into the comments section of a post. This snippet allows you to separate them. The code should go in the comments.php page.

<ul class=”commentlist”>
<?php // only comments

<span style=”white-space: pre;”> </span> <?php foreach ($comments as $comment) : ?>
<span style=”white-space: pre;”> </span> <?php $comment_type = get_comment_type(); ?>
<span style=”white-space: pre;”> </span> <?php if($comment_type == ‘comment’) { ?>
<span style=”white-space: pre;”> </span> <li>//Comment code goes here </li>
<span style=”white-space: pre;”> </span> <?php }
endforeach;
</ul>

<ul>
<?php // only trackbacks

<span style=”white-space: pre;”> </span>foreach ($comments as $comment) : ?>
<span style=”white-space: pre;”> </span> <?php $comment_type = get_comment_type(); ?>
<span style=”white-space: pre;”> </span> <?php if($comment_type != ‘comment’) { ?>
<span style=”white-space: pre;”> </span> <li> <?php comment_author_link() ?></li>
<span style=”white-space: pre;”> </span> <?php }
endforeach;
</ul>

Disable all Comments

This snippet will allow you to disable all comments if you are not looking for the users inputs.

UPDATE wp_posts SET comment_status = ‘closed’, ping_status = ‘closed’;

Enable all comments

This snippet will allow you to enable all comments.

UPDATE wp_posts SET comment_status = ‘open’, ping_status = ‘open’;

Excluded Categories from Your Home Page

This snippet will allow you to exclude categories from your home page. This can be useful if you only want to display specific content. Using a – before the category number makes them not visible and this code should go in your functions.php file.

function excludeCat($query) {
if ( $query->is_home ) {
$query->set(‘cat’, ‘-3,-5,-23’);
}
return $query;
}
add_filter(‘pre_get_posts’, ‘excludeCat’);

Display Different Content to Mac and Windows Users

This snippet is useful if your site has a lot of downloads. It will allow you to change the displayed content for a Mac, allowing you to change the file that a link points to.

<?php
if (stristr($_SERVER[‘HTTP_USER_AGENT’],”mac”)) {
echo ‘Hello, I’m a Mac.’;
} else {
echo ‘And I’m a PC.’;
}
?>

Filter Your Search Results

This snippet will give your users the ability to filter their search results. This can be beneficial to both the user and the webmaster. The code will need to go in the functions.php file.

function SearchFilter($query) {
if ($query->is_search) {
$query->set(‘post_type’,array(‘post’,’page’));
}
return $query;
}
add_filter(‘pre_get_posts’,’SearchFilter’);

Display Number of Twitter Followers

This handy snippet allows you to display the number of twitter followers a specific user has. Change the USERNAME to your twitter username and add to your template.

<?php
$twit = file_get_contents(‘http://twitter.com/users/show/USERNAME.xml’);
$begin = ‘<followers_count>’; $end = ‘</followers_count>’;
$page = $twit;
$parts = explode($begin,$page);
$page = $parts[1];
$parts = explode($end,$page);
$tcount = $parts[0];
if($tcount == ”) { $tcount = ‘0’; }
echo ‘<b> ‘.$tcount.’ </b> followers.’;
?>

Display a User’s Twitter Name

This snippet will allow you to display a user’s Twitter name in whatever section you put this code. This will allow you to give your visitors a warm welcome.

if (strpos($_SERVER[HTTP_REFERER], “twitter.com”) == true) {
echo “Hello Twitter User!”;
}

Display Total Number of Posts

With this snippet you can display the total number of published posts you have on your WordPress website. You can even exclude categories if you would like.

All posts

<?php
$total = wp_count_posts()->publish;
echo ‘Total Posts: ‘ . $total;
?>

Only posts from selected categories.

<?php
$categories = get_categories(‘exclude=1,2,3’);
foreach($categories as $category) {
$total += $category->count;
}
echo ‘Total Posts: ‘ . $total;
?>

Display Total Number of Facebook Fans

This snippet gives you the ability to display the total number of Facebook fans you have. All you need to do is replace “YOUR PAGE_ID” with your own page-id.

<?php
$page_id = “YOUR PAGE-ID”;
$xml = @simplexml_load_file(“http://api.facebook.com/restserver.php?method=facebook.fql.query&query=SELECT%20fan_count%20FROM%20page%20WHERE%20page_id=”.$page_id.””) or die (“a lot”);
$fans = $xml->page->fan_count;
echo $fans;
?>


Page 26 – Web Hosting Secret Revealed




15 Cool JavaScript Sample Snippets



alt="15 Cool JavaScript Sample Snippets" src="http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2015/04/default-image-500x308_c.jpg" />

A Quick Overview On JavaScript

JavaScript is used everywhere online these days – to improve website interactivity, to validate information, and/or to improve a website outlooks. JavaScript first appeared in 1995 and has come a long way since then in terms of being accepted and how it is used. The syntax used in JavaScript was strongly influenced by C; but Java, Pearl, Python, and Scheme also played its part too.

What Is JavaScript?

There’s an old YouTube clip answers the question well. Here goes.

class="border" width="600" height="437" src="http://www.youtube.com/embed/qtzjzMsJiO8" frameborder="0" allowfullscreen>

Beginner Tips: What You Need To Know?

For starters, a few basics you need to know are:

  • JavaScript can be turned off in the browser
  • JavaScript will run each time a page is loaded
  • JavaScript takes time to load on a slow Internet connection
  • JavaScript is still ran from cached pages
  • You can host JavaScript within a web page or externally from a .js file
  • JavaScript is completely different than Java

It is also important to understand that JavaScript will actually lead to disaster when it’s used in a wrong way. Poorly configured and sloppy coded JavaScripts will slow your website and damage the overall site navigation. This in turn affect the return rate of your visitors (due to bad user experience) as well as search engine rankings (due to slow website response rates).  To help validate my case here, put yourself in the shoes of a viewer. If a website you were visiting loaded slowly, was difficult to navigate, and in overall, unappealing – would you return to the site? I wouldn’t.

Below is a small list of things to think about when adding JavaScript to your website.

  • Is JavaScript required for the site to function properly?
  • What will the site look like if the JavaScript was blocked?
  • Will the JavaScript harm the server performance?
  • Will adding the JavaScript help move your site in the direction you want it to go?

No, I am not trying to scare you away with these points. In fact, don’t be afraid to use JavaScript on your websites as it provides tons benefits and, as mentioned, it’s used by the majorities. The key point I am trying to get across here is don’t just keep adding JavaScript features to a site when they are unnecessary. Some sites are will need more JavaScript than the rest; some just need less – Just because one site is doing it doesn’t mean you should do the same.

Freebies: 15 Cool JavaScript Snippets For Your Website

src="http://www.webhostingsecretrevealed.com/images/2012/0306-2.jpg" alt="JavaScript Snippet" class="border" />

Now, let’s get down to the stuffs that you came here for – below is a list of 15 JavaScript snippets that will enhance your site in either functionality or appearance. The code will be broken down into two sections, the head and body or .js file. If no section title is given then it is not needed for that particular snippet.

Understanding HTML5 Video

Quick Sample

<script type="text/javascript">

function understands_video() {
return !!document.createElement(‘video’).canPlayType; // boolean
}

if ( !understands_video() ) {
// Must be older browser or IE.
// Maybe do something like hide custom
// HTML5 controls. Or whatever…
videoControls.style.display = ‘none’;
}

</script>

What does the JavaScript snippet do?


This little snippet will prevent your website from trying to display a video that the browser cannot support, saving you bandwidth and processing power.

JavaScript Cookies/>

Quick Sample

<script type="text/javascript">

/**

* Sets a Cookie with the given name and value.

*

* name       Name of the cookie

* value      Value of the cookie

* [expires]  Expiration date of the cookie (default: end of current session)

* [path]     Path where the cookie is valid (default: path of calling document)

* [domain]   Domain where the cookie is valid

*              (default: domain of calling document)

* [secure]   Boolean value indicating if the cookie transmission requires a

*              secure transmission

*/                        

function setCookie(name, value, expires, path, domain, secure) {

    document.cookie= name + "=" + escape(value) +

        ((expires) ? "; expires=" + expires.toGMTString() : "") +

        ((path) ? "; path=" + path : "") +

        ((domain) ? "; domain=" + domain : "") +

        ((secure) ? "; secure" : "");

}

</script>

 

<script type="text/javascript">

/**

* Gets the value of the specified cookie.

*

* name  Name of the desired cookie.

*

* Returns a string containing value of specified cookie,

*   or null if cookie does not exist.

*/

function getCookie(name) {

    var dc = document.cookie;

    var prefix = name + "=";

    var begin = dc.indexOf("; " + prefix);

    if (begin == -1) {

        begin = dc.indexOf(prefix);

        if (begin != 0) return null;

    } else {

        begin += 2;

    }

    var end = document.cookie.indexOf(";", begin);

    if (end == -1) {

        end = dc.length;

    }

    return unescape(dc.substring(begin + prefix.length, end));

}

</script>

 

<script type="text/javascript">

/**

* Deletes the specified cookie.

*

* name      name of the cookie

* [path]    path of the cookie (must be same as path used to create cookie)

* [domain]  domain of the cookie (must be same as domain used to create cookie)

*/

function deleteCookie(name, path, domain) {

    if (getCookie(name)) {

        document.cookie = name + "=" +

            ((path) ? "; path=" + path : "") +

            ((domain) ? "; domain=" + domain : "") +

            "; expires=Thu, 01-Jan-70 00:00:01 GMT";

    }

}

</script>

What does the JavaScript snippet do?

This snippet is a little long but very useful, it will allow your site to store information on the viewer’s computer then read it at another point in time. This snippet can be used in many different ways to accomplish different tasks.

Preload your images/>

Quick Sample

<script type="text/javascript">

var images = new Array();

function preloadImages(){

    for (i=0; i < preloadImages.arguments.length; i++){

         images[i] = new Image();

        images[i].src = preloadImages.arguments[i];

    }

}

preloadImages("logo.jpg", "main_bg.jpg", "body_bg.jpg", "header_bg.jpg");

</script>

What does the JavaScript snippet do?

This snippet will prevent your site from having that awkward time when it is only displaying part of the site; this not only looks bad but is also unprofessional. All you have to do is add your images to the preloadImages section and you are ready to roll.

E-mail Validation

Quick Sample

Head:

<script type="text/javascript">
function validateEmail(theForm) {
if (/^w+([.-]?w+)*@w+([.-]?w+)*(.w{2,3})+$/.test(theForm.email-id.value)){
return(true);
}
alert("Invalid e-mail address! Please enter again carefully!.");
return(false);
}
</script>

Body:

<form onSubmit="return validateEmail(this);" action="">
E-mail Address:
<input type="text" name="emailid" />
<input type="submit" value="Submit" />
<input type="reset" value="Reset" />
</form>

What does the JavaScript snippet do?

This snippet will validate that a properly formatted E-mail address is entered in a form, it cannot guarantee that the E-mail address is real, there is no way to check for that with JavaScript.

No Right-Click

Quick Sample

<script type="text/javascript">
function f1() {
  if(document.all) { return false; }
}
function f2(e) {
  if(document.layers || (document.getElementById &! document.all)) {
    if(e.which==2 || e.which==3) { return false; }
  }
}
if(document.layers) {
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown = f1;
}
else {
  document.onmouseup = f2;
  document.oncontextmenu = f1;
}
document.oncontextmenu = new function("return false");
</script>

What does the JavaScript snippet do?

This snippet will prevent the viewer from being able to right-click on your page. This can discourage the average user from borrow images or code from your site.

Display Random Quotes

Quick Sample

Head:

<script type="text/javascript">
  writeRandomQuote = function () {
    var quotes = new Array();
    quotes[0] = "Action is the real measure of intelligence.";
    quotes[1] = "Baseball has the great advantage over cricket of being sooner ended.";
    quotes[2] = "Every goal, every action, every thought, every feeling one experiences, whether it be consciously or unconsciously known, is an attempt to increase one’s level of peace of mind.";
    quotes[3] = "A good head and a good heart are always a formidable combination.";
    var rand = Math.floor(Math.random()*quotes.length);
    document.write(quotes[rand]);
  }
  writeRandomQuote();
</script>

Body:

<script type="text/javascript">writeRandomQuote();</script>

What does the JavaScript snippet do?

Ok so this is not a snippet that all sites would use but it can be used to display more than just random quotes. You can change the content ok the quotes to whatever you want and have random images or text displayed anywhere on your site.

Previous/Next Links

Quick Sample

<a href="javascript:history.back(1)">Previous Page</a> | <a href="javascript:history.back(-1)">Next Page</a>

What does the JavaScript snippet do?

This snippet is great if you have multiple pages on an article or tutorial. It will allow the user the browse between the pages with ease. It is also small and light weight from a resource point of view.

Bookmark a Page

Quick Sample

<a href="javascript:window.external.AddFavorite(‘http://www.yoursite.com’, ‘Your Site Name’)">Add to Favorites</a>

What does the JavaScript snippet do?

This snippet will allow the user to bookmark your page with ease; all they have to do is click the link. Its little features like this that can increase your viewers overall experience.

Easy Print Page Link

Quick Sample

<a href="javascript:window.print();">Print Page</a>

What does the JavaScript snippet do?

This little link will allow your views to easily print your page. It utilizes the quick print feature already setup by your browser and utilizes no resources until it is clicked.

Show Formatted Date

Quick Sample

Head:

<script type="text/javascript">
  function showDate() {
    var d = new Date();
    var curr_date = d.getDate();
    var curr_month = d.getMonth() + 1; //months are zero based
    var curr_year = d.getFullYear();
    document.write(curr_date + "-" + curr_month + "-" + curr_year);
  }
</script>

Body:

<script type="text/javascript">showDate();</script>

What does the JavaScript snippet do?

This snippet will allow you to display the current date anywhere on your webpage and does not need to be updated. Simply put it in place and forget about it.

Comma Separator

Quick Sample

Head:

<script type="text/javascript">
function addCommas(num) {
  num += ”;
  var n1 = num.split(‘.’);
  var n2 = n1[0];
  var n3 = n1.length > 1 ? ‘.’ + n1[1] : ”;
  var temp = /(d+)(d{3})/;
  while (temp.test(n2)) {
    n2 = n2.replace(temp, ” + ‘,’ + ”);
  }
  var out = return n2 + n3;
  document.write(out);
}
</script>

Body:

<script type="text/javascript">addCommas("4550989023");</script>

What does the JavaScript snippet do?

This snippet would be used mainly by sites that use numbers often. This snippet will keep your numbers looking the same across the board. All you have to do is copy the body line where you want to add a number and replace the number there with your number.

Get the Display Area of a Browser/>

Quick Sample

<script type="text/javascript">

<!–

var viewportwidth;

var viewportheight;

// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight

if (typeof window.innerWidth != ‘undefined’)

{

      viewportwidth = window.innerWidth,

      viewportheight = window.innerHeight

}

// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

else if (typeof document.documentElement != ‘undefined’

     && typeof document.documentElement.clientWidth !=

     ‘undefined’ && document.documentElement.clientWidth != 0)

{

       viewportwidth = document.documentElement.clientWidth,

       viewportheight = document.documentElement.clientHeight

}

// older versions of IE

else

{

       viewportwidth = document.getElementsByTagName(‘body’)[0].clientWidth,

       viewportheight = document.getElementsByTagName(‘body’)[0].clientHeight

}

document.write(‘<p>Your viewport width is ‘+viewportwidth+’x’+viewportheight+'</p>’);

//–>

</script>

What does the JavaScript snippet do?

This snippet will allow you to get the width and height of the display area in your views browser. This will give the designer the ability to create and use different displays based on the size of the user’s browser window.

Redirect with Optional Delay

Quick Sample

<script type="text/javascript">

setTimeout( "window.location.href =

‘http://walkerwines.com.au/’", 5*1000 );

</script>

What does the JavaScript snippet do?

This snippet will allow you to redirect your viewers to another page and it has the option of setting a delay. The use of this snippet is pretty self-explanatory and it is a very valuable tool to have in your belt.

Detect iPhones

Sample

<script type="text/javascript">

if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {

    if (document.cookie.indexOf("iphone_redirect=false") == -1) {

        window.location = "http://m.espn.go.com/wireless/?iphone&i=COMR";

    }

}

</script>

What does the JavaScript snippet do?

This snippet will allow you to detect if your viewer is on an iPhone or iPod allowing you to display different content to them. This snippet is invaluable with how large the mobile market is and it is only going to continue to grow.

Print Message to Status Bar

Quick Sample

<script language="javascript" type="text/javascript">
<!–
   window.status = "<TYPE YOUR MESSAGE>";
// –>
</script>

What does the JavaScript snippet do?


This little snippet will allow you to print a message to the status bar. You can display recent or important news in an area the will catch the eye of the user.


Page 25 – Web Hosting Secret Revealed