import java.io.FileNotFoundException
import java.util.Scanner
public class Readtxt {
public static void main(String[] args) {
try {
Scanner in = new Scanner(new File("d:/abc.txt"))
while (in.hasNextLine()) {
String str = in.nextLine()
splitt(str)
}
} catch (FileNotFoundException e) {
e.printStackTrace()
}
}
public static String[] splitt(String str){
String strr = str.trim()
String[] abc = strr.split("[\\p{Space}]+")
String str1 = abc[0]
String str2 = abc[1]
System.out.println(str1)
System.out.println(str2)
return abc
}
}
这个方法可以读到后台,然后再传到前台就可以了
把要输出的html全部写在某个id中,然后复制过去,你想放多少都行
<script type="text/javascript">window.onload=function(){
var _acon=document.getElementById("aaa").innerHTML
var _bbb=document.getElementById("bbb")
_bbb.innerHTML=_acon
}
</script>
<div id="aaa">
<div class="test">
<ul>
<li>aaaaaaa</li>
<li>bbbbbbb</li>
<li>ccccccc</li>
</ul>
</div>
</div>
<div id="bbb"></div>