I know this is very old post but with php or asp you can do this. but it will still be available to advanced geeks.
basically you need 3 files
1. functions.js file
function testfunc(){
alert("test to see if it works...");
}
2. null_functions.php
<?php
$datetime=base64_encode(date("YmdHis") * 1.35489);
$cache = getparam("cache");
if ($datetime == $cache) {
$js = file_get_contents("functions.js");
echo $js;
}
//****************************************************************************************************
// functions
//****************************************************************************************************
function getparam($name)
{
if (is_string($name))
{
if ((bool)get_magic_quotes_gpc())
{
set_magic_quotes_runtime(0);
$param = isset($_POST[$name]) ? stripslashes($_POST[$name]) : false;
$param = isset($_GET[$name]) ? stripslashes($_GET[$name]) : $param;
}
else
{
$param = isset($_POST[$name]) ? $_POST[$name] : false;
$param = isset($_GET[$name]) ? $_GET[$name] : $param;
}
return $param;
}
else
{
return $name;
}
}
?>
3. index.php
<!DOCTYPE html>
<html>
<head>
<?php
$cache = base64_encode(date("YmdHis") * 1.35489); // multiply by some random number this must be same as on null_functions.php page
?>
<script src="<?php echo "null_functions.php?cache=$cache";?>">
</script>
</head>
<body onload="javascript:testfunc()">
</body>
</html>