ベンダーとクライアントのさまざまなドメインを持つ100以上の電子メールIDを持つテキストファイルがあります。テキストファイルを3つのカテゴリにパースし、htmlとして表示
例:
[email protected],[email protected]
私はxyz.comとgyx.com同様にretuns別のものとの電子メールIDを抽出して表示するボタンを配置したいです。 PHPがなければ、私はローカルサーバーをインストールしていません。
どこから始めたらいいかわかりません。
これは現在テキストファイルを読むために使用しているコードです。文書は私が出力されたデータのすべてをつかむだろうjQueryのを使用して、アップロードしたら
:
<!DOCTYPE html>
<html>
<head>
<title>Read File (via User Input selection)</title>
<script type="text/javascript">
var reader;
function checkFileAPI() {
if (window.File && window.FileReader && window.FileList && window.Blob) {
reader = new FileReader();
return true;
} else {
alert('The File APIs are not fully supported by your browser. Fallback required.');
return false;
}
}
function readText(filePath) {
var output = ""; //placeholder for text output
if(filePath.files && filePath.files[0]) {
reader.onload = function (e) {
output = e.target.result;
displayContents(output);
};//end onload()
reader.readAsText(filePath.files[0]);
}//end if html5 filelist support
else if(ActiveXObject && filePath) { //fallback to IE 6-8 support via ActiveX
try {
reader = new ActiveXObject("Scripting.FileSystemObject");
var file = reader.OpenTextFile(filePath, 1); //ActiveX File Object
output = file.ReadAll(); //text contents of file
file.Close(); //close file "input stream"
displayContents(output);
} catch (e) {
if (e.number == -2146827859) {
alert('Unable to access local files due to browser security settings. ' +
'To overcome this, go to Tools->Internet Options->Security->Custom Level. ' +
'Find the setting for "Initialize and script ActiveX controls not marked as safe" and change it to "Enable" or "Prompt"');
}
}
}
else { //this is where you could fallback to Java Applet, Flash or similar
return false;
}
return true;
}
/**
* display content using a basic HTML replacement
*/
function displayContents(txt) {
var el = document.getElementById('main');
el.innerHTML = txt; //display output in DOM
}
</script>
</head>
<body onload="checkFileAPI();">
<div id="container">
<input type="file" onchange='readText(this)' />
<br/>
<hr/>
<h3>Contents of the Text file:</h3>
<div id="main">
...
</div>
</div>
</body>
</html>
どこから始めるのかわからない理由は、説明したように、あなたがしたいことが全くわかりません。 – RamblinRose
あなたはドラッグアンドドロップを使用しようとしていますか? – Jhecht
これはあなたの古い質問を解決しますか?そうであれば、解決済みとマークしてください。あなたはあまりにも良い評判を得ることができます。 –