Automagic上一页/下一页链接

编程入门 行业动态 更新时间:2024-10-24 02:01:10
本文介绍了Automagic上一页/下一页链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我做了一个网站,我在每个页面的底部都有一个上一个和下一个链接 。它看起来像是: < p>< a href =" foo01.html"> Previous< / a> | < a href =" foo03.html"> Next< / a>< / p> 看到他们总是按顺序排列,有没有办法使用JS自动转到上一个文件或下一个文件? Ian - sundry.ws

I do a site where I have a previous and next link at the bottom of every page. It looks like: <p><a href="foo01.html">Previous</a> | <a href="foo03.html">Next</a></p> Seeing as they''re always in sequential order, is there a way to automagically go to the previous file or the next file using JS? Ian -- sundry.ws

推荐答案

Ian Rastall于2006年18月18日在comp.lang.javascript中写道 : Ian Rastall wrote on 18 mrt 2006 in comp.lang.javascript: 我做了一个网站,我有一个上一个和下一个链接在每页的底部。它看起来像: < p>< a href =" foo01.html"> Previous< / a> | < a href =" foo03.html"> Next< / a>< / p> 看到他们总是按顺序排列,有没有办法使用JS自动转到上一个文件或下一个文件? I do a site where I have a previous and next link at the bottom of every page. It looks like: <p><a href="foo01.html">Previous</a> | <a href="foo03.html">Next</a></p> Seeing as they''re always in sequential order, is there a way to automagically go to the previous file or the next file using JS?

使用服务器端J(ava)脚本/ ASP: <%@ language =" jscript"%> <% thisOne = request.servervariables(''SCRIPT_NAME'') thisNumber = + thisOne.replace(/.*?\ // g,'''')。replace(/ \D + / g,'''') nextNumber = ++ thisnumber if(nextNumber< 0 || nextNumber> 99)nextNumber = 0 nextNumber =(nextNumber< 10)?''0' '+ nextNumber:nextNumber //对于lastNumber大致相同 %> < a href =" foo<%= lastNumber%> .html">上一页< / a> | < a href =" foo<%= nextNumber%> .html"> Next< / a> 未经测试 - Evertjan。 荷兰。 (请将x''改为我的电子邮件中的点)

Using serverside J(ava)script/ASP: <%@ language="jscript"%> <% thisOne = request.servervariables(''SCRIPT_NAME'') thisNumber = +thisOne.replace(/.*?\//g,'''').replace(/\D+/g,'''') nextNumber = ++thisnumber if(nextNumber<0||nextNumber>99)nextNumber=0 nextNumber = (nextNumber<10)?''0''+nextNumber:nextNumber //about the same for lastNumber %> <a href="foo<%=lastNumber%>.html">Previous</a> | <a href="foo<%=nextNumber%>.html">Next</a> Not tested -- Evertjan. The Netherlands. (Please change the x''es to dots in my emailaddress)

Evertjan。写道: Evertjan. wrote: 使用serverside J(ava)脚本/ ASP: Using serverside J(ava)script/ASP:

你好Evertjan。我从来没有使用过服务器端的JS,也不知道是否 AffordableHost使用它。 (我不得不问。)两个问题: 1.是否需要我更改扩展名? 2.可以完成吗客户端? 我要做的是让每一页尽可能接近 。我现在正在处理超过2,500个文件,并且手工执行这些文件 。 我想知道预处理器是否可行,但是''一个问题 CIWAH,我想。 Ian - sundry.ws

Ian Rastall写道: Ian Rastall wrote: Evertjan。写道: Evertjan. wrote: 使用serverside J(ava)脚本/ ASP: Using serverside J(ava)script/ASP:

1.是否需要我更改扩展名? 这取决于主机 2.可以在客户端完成吗? 如果客户端脚本不可用或关闭它会破坏 (这涵盖了大量用户和所有主要搜索引擎 索引器)。 我想知道预处理器是否可行, 可能 但这是一个问题对于CIWAH,我想。

1. Would it require me to change the extensions? That depends on the host 2. Can it be done client-side? Then it would break if client side scripting was unavailable or turned off (this covers a significant number of users and all major search engine indexers). I wonder if a preprocessor would work, Probably but that''s a question for CIWAH, I imagine.

你可以在JavaScript中写一个:) - David Dorward< blog.dorward.me.uk/> < dorward.me.uk/> 首页是〜/ .bashrc的位置

You could write one in JavaScript :) -- David Dorward <blog.dorward.me.uk/> <dorward.me.uk/> Home is where the ~/.bashrc is

更多推荐

Automagic上一页/下一页链接

本文发布于:2023-06-13 05:24:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/674892.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:下一页   上一页   链接   Automagic

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!