"Sharad Gupta" <g_******@yahoo.com> wrote in message
news:41**********************@news.newsgroups.ws.. .
hi
thru the code i am able to generate the filename extension and not the
primary name of the filename.
ie we1234.xyz
i am getting xyz, where as i want we1234
still waiting
Were you waiting for me to respond?
Here's a variation of what I posted before.
Watch for word-wrap.
<html>
<head>
<title>show.htm</title>
<script type="text/javascript">
function showfile() {
var pathname = location.pathname;
var filename =
pathname.substr(pathname.lastIndexOf("\\")+1,pathn ame.length);
alert(filename);
}
function showpath() {
var pathname = location.pathname;
pathname = pathname.substr(1,pathname.length);
alert(pathname);
}
function showpref() {
var pathname = location.pathname;
var filename =
pathname.substr(pathname.lastIndexOf("\\")+1,pathn ame.length);
filename = filename.substr(0,filename.indexOf("."))
alert(filename);
}
function showimage(that) {
alert(that.name);
}
</script>
</head>
<body>
<input type="button" value="Path+File" onclick="showpath()">
<input type="button" value="File Only" onclick="showfile()">
<input type="button" value="File Pref" onclick="showpref()">
<img src="http://www.google.com/images/logo.gif" name="Google"
onclick="showimage(this)">
</body>
</html>