求点击下页显示一个URL递增的JS效果 就是 点击"下页" 链接,在不刷新当前页面的情况下,让当前页里的一个超链接地址按数字1递增, 数字的范围可指定.例如地址是: http://forum.csdn.net/down/1001.zip 文件名1001是需要递增的变量. 则每点"下页"一次,链接里的数字就按指定范围递增1位. 谢谢~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><script type="text/javascript"> window.onload = function(){ var aTag = document.getElementById('next'); aTag.onclick = function(e){ preventDefault(e); var url = aTag.getAttribute('href'); var count = parseInt(url.substr(url.lastIndexOf('/') + 1,5)); var c = count + 1; aTag.setAttribute('href',url.substr(0,url.lastIndexOf('/')) + '/' + c + '.zip'); alert(aTag.href); }; function preventDefault(e){ eventObject = e || window.event; if(eventObject.preventDefault){ eventObject.preventDefault(); }else{ eventObject.returnValue = false; } }; };</script></head><body> <a href="http://forum.csdn.net/down/1001.zip" id="next">下一页</a></body></html> 谢谢LS的,不过 这个递增的地址不和下页在一起的. 而是和"下页"按钮分开的,点击按钮 ,上面的那个超链接地址就递增一位,而且递增后的链接都是可点击的.不是alt弹窗提示.谢谢~ <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><script type="text/javascript"> window.onload = function(){ var aTag = document.getElementById('a'); var butt = document.getElementById('next'); butt.onclick = function(e){ var url = aTag.getAttribute('href'); var count = parseInt(url.substr(url.lastIndexOf('/') + 1,5)); var c = count + 1; aTag.setAttribute('href',url.substr(0,url.lastIndexOf('/')) + '/' + c + '.zip'); }; };</script></head><body> <a href="http://forum.csdn.net/down/1001.zip" id="a">跳转链接</a> <input type="button" id="next" value="点我增加" /></body></html> 我终于解决了困惑已久的样式问题,现求jquery里fadeout和fadein里的具体代码 怎么给grid 第一列 Ext.grid.ColumnModel设置高度? 程序控制光标在文本区域移动 Js 如何让时间相加? 怎样设置我的昵称? ASP.NET 后台如何调用前台的变量? 问个关于隐藏层的简单问题. 一个让我费解的问题 js的一个小语法问题 如何用javascript在图片上画线?高手请帮忙!! fck的GetXHTML()很慢,大家有什么好办法么? js 怎么传值??
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
window.onload = function(){
var aTag = document.getElementById('next');
aTag.onclick = function(e){
preventDefault(e);
var url = aTag.getAttribute('href');
var count = parseInt(url.substr(url.lastIndexOf('/') + 1,5));
var c = count + 1;
aTag.setAttribute('href',url.substr(0,url.lastIndexOf('/')) + '/' + c + '.zip');
alert(aTag.href);
};
function preventDefault(e){
eventObject = e || window.event;
if(eventObject.preventDefault){
eventObject.preventDefault();
}else{
eventObject.returnValue = false;
}
};
};
</script>
</head><body>
<a href="http://forum.csdn.net/down/1001.zip" id="next">下一页</a>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
window.onload = function(){
var aTag = document.getElementById('a');
var butt = document.getElementById('next');
butt.onclick = function(e){
var url = aTag.getAttribute('href');
var count = parseInt(url.substr(url.lastIndexOf('/') + 1,5));
var c = count + 1;
aTag.setAttribute('href',url.substr(0,url.lastIndexOf('/')) + '/' + c + '.zip');
};
};
</script>
</head><body>
<a href="http://forum.csdn.net/down/1001.zip" id="a">跳转链接</a>
<input type="button" id="next" value="点我增加" />
</body>
</html>