Handle undefined URL values correctly.

This commit is contained in:
Joel Martin 2010-04-10 15:52:08 -04:00
parent 4b835baeb9
commit 85b7a7d411
1 changed files with 3 additions and 5 deletions

View File

@ -32,11 +32,9 @@
<script>
window.onload = function() {
var uri = new URI(window.location);
$('host').value = uri.getData("host");
$('port').value = uri.getData("port");
if (uri.getData("password")) {
$('password').value = uri.getData("password");
}
$('host').value = uri.getData("host") || '';
$('port').value = uri.getData("port") || '';
$('password').value = uri.getData("password") || '';
}
</script>