云笺根据名字打开目录
例如:test
test_
test_2
打开的都是 test 的目录
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| function openContent() { var name = document.getElementById("name").value; if (name == "") return ; var url = "", pat = /(.+_)\d{1,2}/; if (pat.test(name)) url = name.slice(0, name.lastIndexOf('_')+1); else if (name.lastIndexOf('_') == name.length-1) url = name; else url = name + "_"; window.open("index.php?n=" + encodeURI(url)); return false; }
|
打开下一页
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| function page_next() { var name = document.getElementById("name").value; if (name == "") return ; var url = ""; var pat = /(.+_)\d{1,2}/; if (pat.test(name)) { url = name.slice(0, name.lastIndexOf('_')+1); pagenum = name.slice(name.lastIndexOf("_")+1, name.length); pagenum = parseFloat(pagenum) + 1; url = url + pagenum; } else if (name.lastIndexOf('_') == name.length-1) url = name + "1"; else url = name + "_1"; openYunj2("index.php?n=" + encodeURI(url)); return false; }
|