How can we find the js file is included before or not in drupal I have some functions in template.php file that inside some of them, some js files must be included to the template.

Now, I want to check at first whether a specific js file [for example jquery.min.js] is included before or not. (in order to avoid) duplication.

Is there any way to check this issue in drupal 6??
A. You should not be including jQuery manually in Drupal. Also, jQuery is always loaded on every page. If you need to include a different version of jQuery than the version that is included in Drupal core, you should utilize the jQuery Update module.

B. Secondly, you should be adding your javascript files using the drupal_add_js() function. Utilizing this function will take care of a lot of potential issues involved in managing many javascript files across many pages on your site.

C. drupal_add_js() returns an array of all javascript files. You could load a javascript file conditionally based on the presence of another javascript file, like this:

  $scripts = drupal_add_js();

  if(!isset($scripts['path/to/script.js'])) {
    drupal_add_js('path/to/script.js');
  }


D. Be sure to thoroughly read the Drupal.org documentation about using javascript in Drupal. This will answer many of your questions and solve many of your issues regarding javascript in Drupal.