<!DOCTYPE html>
<html>
<head>
<script>
var sourceMap = {
1: 'one.js',
2: 'two.js'
};
function askUser() {
var answer, script;
answer = prompt("1 или 2 ?");
if (answer in sourceMap) {
script = document.createElement('script');
script.src = sourceMap[answer];
document.body.appendChild( script );
} else {
alert('WTF?');
}
}
</script>
</head>
<body>
<h2>цифра</h2>
<button onclick="askUser()">жми!</button>
</body>
</html>