You can't call server-side code directly, you'll need your server code to render a javascript variable that has the data you need and then use that
On your aspx page (or view if you're using MVC)
<script>
var mySetting = '<%=System.Configuration.ConfigurationManager.AppSettings["MySetting"]%>';
</script>
<script src="/scripts/test.js"></script>
test.js
$(document).ready(function () {
if (typeof (mySetting) == "undefined"){
return;
}
alert(mySetting);
});