You should be able to move the entire JavaScript embedding code into a separate script and then just load this script after loading the 'juicebox.js' script.
I think this should work OK.
At its most basic:
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Juicebox-Pro Gallery</title>
<script src="jbcore/juicebox.js"></script>
<script src="script.js"></script>
</head>
<body>
<div id="juicebox-container"></div>
</body>
</html>
'script.js':
new juicebox({
containerId: 'juicebox-container'
});
I'm not sure what parameter you'd like to pass in the URL but you could do so with a query string, e.g.:
http://www.example.com/index.html?text=hello
You could then fetch the query string parameter from within the script using code such as:
if (window.location.search) {
var key = 'text';
var queryArray = {};
var queryComponent;
var queryString = unescape(window.location.search);
var re = new RegExp('([^?=&]+)(?:=([^&]*))?', 'g');
while (queryComponent = re.exec(queryString)) {
queryArray[queryComponent[1]] = queryComponent[2];
}
var value = queryArray[key];
// Do something with 'value' variable ("hello" in the example above)
}
(This may not be the most compact/optimized code for fetching a query string but it does handle multiple query string parameters.)
I'm not sure if this is exactly what you are looking for but it might point you in the right direction.