0
スプリットメソッドを使用するフォルダからファイルを選択した後、それは全体のパスcを示す:\ fackpath \ xyz.png分割メソッドを使用しているときにエラーが発生するUncaught ReferenceError:関数が定義されていません
<html>
<head>
<script type="text/javascript">
function alertFilename()
{
var thefile = document.getElementById('thefile').value;
var x = thefile.toString()
var y = x.split("\")[0];
var y = document.getElementById('x').value = thefile;
}
</script>
</head>
<body>
<form>
<input type="file" style ="width:90px" id="thefile" onchange="alertFilename()" />
<input type="text" id ="x" value="" />
<p id ="demo"></p>
</form>
</body>
ここ
あるIアタッシュケースplunker link
あなたは 'split(" \\ ")'を試しましたか? – Banzay
いいえ、私は試しませんでした。 – aaakanks
ありがとうございます。 – aaakanks