Here's how to hook it into your open() call (remember that JavaScript is a case-sensitive language, onclose() is not the same as onClose() ):
Shadowbox.open({
content: '<div id="welcome-msg">Welcome to my website!</div>',
player: "html",
title: "Welcome",
height: 350,
width: 350,
onClose: function() {
window.location.reload();
}
});
I would also highly recommend that you look into attaching event handlers using JavaScript, instead of inline the way you did with onclick="open_sbox()". As you learn more JavaScript, you'll find that there are a bunch of disadvantages to attaching this way.
An industry veteran puts it best. If you were using jQuery, and you gave your button id="welcome-button", then you'd do this:
$('#welcome-button').bind('click', function(event) {
Shadowbox.open(
...
);
});