预览模式: 普通 | 列表
08-09
01

在控制层取得<span>...</span>之间的值

在form中写个
<input type="hidden" name="flash">
然后在表单提交上写个button,其上有个Onclick="sendflash();"
<input type="button" onclick="sendflash();">
再在JS中定义这个函数
function sendflash(){
var fl=document.getElementById("myflash");
document.forms[0].flash=fl.innerText;
document.forms[0].submit();

查看更多...

Tags: span

分类:学习 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 531
08-09
01

过滤掉<img> 标记

查找替换!
匹配"<img任意字符[任意个数]>"和"</img>"的替换成""就实现了!

Pattern p = Pattern.compile("<img.*>");
String content = "<img src=\"img/1.jpg\"/>如下说明:";
Matcher m = p.matcher(content);
content = m.replaceAll("");
content = content.replaceAll("</img>", "");

查看更多...

Tags: img 过滤

分类:学习 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 482
08-09
01

查找一个String变量中有多少的###page###

public class Test {
public static void main(String[] args) {
List list = new ArrayList();
String context = "ss###page###ggggg###page###ffferfawe###page###ssa";
String[] numCut = context.split("###page###");
for (String item: numCut) {
list.add(item);
System.out.println(item);
}

查看更多...

Tags: page 查找

分类:学习 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 442