Detect front page in Drupal 6 with javascript Using javascript in Drupal 6, is there a way to detect whether the present page is the front page? I have a custom Drupal 6 module that outputs different javascript codes based on whether the present page is front page or not. It adds a single javascript file to drupal, so I need to put the check in the javascript. 

The site will be served through Varnish cache, so I don't want to add the check in PHP, though I know that would have been way easier with drupal_is_front_page().

Is there any Drupal-native way to do this? jQuery based suggestions will be highly appreciated.

Thanks.
Generally Drupal adds a "front" class to the body element of whatever page is acting as the front page. If your theme's page.tpl.php is printing the body classes (i.e &lt;body class="&lt;?php echo $classes; ?&gt;"), which it most likely is (it should), then your javascript can check if the body element has the "front" class.

So, assuming jQuery (because Drupal includes it) then you'd do:

if ($('body').hasClass('front')) { // do stuff...}