Add the following (?js_resource=true) at the end of your JS link in the HTML page:
Code:<script type="text/javascript" src="/scriptname.js?js_resource=true"></script>
Then in robots.txt add the following:
Code:Disallow: /*.js?js_resource
and if in the script itself where to add the code