var domain = 'http://' + location.hostname + '/'; var charsstring = domain.length; var newUrl = document.location.toString(); var filename = newUrl.substring(charsstring); document.write("");