basically the script below has a form, and when the user submits, the javascript checks the value of the form and removes everything but the file name, makes a fake loading page, and then shows the file name.

example
Code:
"http://facebook.com/home.php" would become "home.php"
"http://google.com/search.php?term=yahoo.com&color=blue" would become "search.php"
this works in every browser, (yes including ie), except firefox. anyone se anything wrong?


Code:
<html>
<head>
<script type="text/javascript">
function getfilename() {
var url = document.getElementById('urlinsert').value;
var lastSlash = url.lastIndexOf("/");
var firstQuestionMark = url.indexOf("?");
if(firstQuestionMark == -1)
{
firstQuestionMark = url.length;
}
var fileName = url.substring(lastSlash + 1, firstQuestionMark);
content.innerHTML = '<br /><div id="loading"><img src="loading.gif" /></div><div id="download" style="display:none;">download: <a href="http://www.example.com/download.php?file=' + fileName + '">' + fileName + '</a><br /></div><br />';
setTimeout("document.getElementById('loading').style.display = 'none';", 3000);
setTimeout("document.getElementById('download').style.display = 'inline';", 3100);
}
</script>
</head>
<body>
 <input type="text" id="urlinsert" value="paste rapidshare url here" onKeyPress="return disableEnterKey(event)" onFocus="if (this.value == 'paste rapidshare url here') {this.value = '';}" onBlur="if (this.value == '') {this.value = 'paste rapidshare url here';}"></input>
<a href="#" onClick="getfilename()" class="submit" style="cursor:pointer">submit</a>
</body>
</html>