function number(result) {
var reg = /\/\d+(?=\.)/; /*regular expression to get the filename*/
var reg2 = /\d+/;
var filename = document.URL;
var filename = reg.exec(filename); //exective the reuglar expression
result = reg2.exec(filename); //get the file name without filetype
//alert(parseInt(result) + 1 + ".htm");
}
我利用一个javascript函数获取当前网页名称,再经过一些变换之后,放入到html的连接中。比如上面的代码,我result的结果是1,那么我想在页面中添加一个html连接,打开2.htm,请问怎么做。
<a href="">aaa</a>