Sometimes you need to use a slider, slideshow or some javascript effect that will appear only in your home page. Therefore, you don't need all of your pages to include in the <head> section the JavaScript code that is used for that purpose. All you need to do is to put your JavaScript code between the following lines of code.
<?php if (is_home() ):?>
... your JavaScript code goes here...
<?php endif; ?>
Tags: JavaScript and Wordpress, JavaScript in Home Page only