Created
February 1, 2011 07:16
-
-
Save ETBlue/805535 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var csvFile=new XMLHttpRequest(); | |
var filePath="file:///home/etblue/Codes/translation/rails-guide-glossary-list-zh_tw.csv" | |
csvFile.open("GET", filePath, false); | |
csvFile.send(); | |
glossary = csvFile.responseText.split("\n"); | |
for(var i=0;i<glossary.length;i++) | |
{ | |
words=glossary[i].split(","); | |
var en=" "+words[1]+" "; | |
var zh=words[2]; | |
var suggest=words[3]; | |
var pattern=new RegExp(en,'g'); | |
document.body.innerHTML = document.body.innerHTML.replace(pattern,'<B style="color:red;">'+en+'<small style="color:green;">中譯:'+zh+',翻譯方式:'+suggest+'</small></B> '); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment