使用'变量'来避免重复输入网址? [英] Use a 'variable' to avoid repeatedly typing URLs?

查看:71
本文介绍了使用'变量'来避免重复输入网址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Group,


这是一个常见的问题:我在网页上有很多(100)个链接,

都指向不同的页面相同的域名(例如,http://

www.x12345.com/")。


这是一个麻烦,因为(1)这需要大量打字,而且(2)更多

重要的是,如果(或何时)主URL发生变化,则需要大量工作

才能更新链接。


有没有一种简单的方法可以在我的html中指定某个地方

"变量" (例如$ urlname),然后给它赋值,这样在页面后面我可以引用这个变量而不是完整的

URL?


提前致谢。


John Uebersax

Hi Group,

Here is a common problem: I have many (100) links on a web page,
all pointing to different pages on the same domain (e.g., "http://
www.x12345.com/").

This is a bother because (1) it takes a lot of typing, and (2) more
importantly, if (or when) the main URL changes, it takes a lot of work
to update the links.

Is there an easy way to specify somewhere in my html a
"variable" (e.g. "$urlname"), and then assign it a value, so that
later in the page I can refer to this variable instead of the full
URL?

Thanks in advance.

John Uebersax

推荐答案

urlname"),然后给它分配一个值,以便

稍后在页面中我可以引用这个变量而不是完整的

URL?


提前致谢。


John Uebersax
urlname"), and then assign it a value, so that
later in the page I can refer to this variable instead of the full
URL?

Thanks in advance.

John Uebersax


John U.写道:
John U. wrote:

Hi Group,


这是一个常见问题:我在网页上有很多(100)个链接,

都指向同一域上的不同页面(例如,http://

www.x12345.com/")。


这是一个麻烦,因为(1)它需要大量打字,而且(2)更多

重要的是,如果(或何时)主URL发生变化,则需要大量工作

来更新电子链接。
Hi Group,

Here is a common problem: I have many (100) links on a web page,
all pointing to different pages on the same domain (e.g., "http://
www.x12345.com/").

This is a bother because (1) it takes a lot of typing, and (2) more
importantly, if (or when) the main URL changes, it takes a lot of work
to update the links.



任何文本编辑器 - 甚至是Windows记事本 - 都有一个搜索和替换功能

将为您改变域名单个操作。

Any text editor--even Windows Notepad--has a search-and-replace feature
that will change the domain for you in a single operation.


是否有一种简单的方法可以在我的html中指定某个地方

"变量" (例如
Is there an easy way to specify somewhere in my html a
"variable" (e.g. "


urlname"),然后为它赋值,这样

后面的页面我可以引用这个变量而不是完整的

网址?
urlname"), and then assign it a value, so that
later in the page I can refer to this variable instead of the full
URL?



是的,如果你正在使用* any *动态服务器端Web技术(ASP.NET,

PHP等等) ),然后你只需设置一个变量并坚持


<%= domainName%>


例如,无论你需要什么。


我假设您正在谈论的域名与您的页面所在的域名不同

。如果它是所有相同的网站,那么你根本就不使用

http://domain.name 部分。

Yes, if you''re using *any* dynamic server-side Web technology (ASP.NET,
PHP, etc.), then you just set a variable and stick

<%=domainName%>

for example, wherever you need to.

I''m assuming the domain you''re talking about is different from the one
your page is on. If it''s all the same website, then you simply don''t use
the http://domain.name part at all.


这篇关于使用'变量'来避免重复输入网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆