且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

html页面中的引用

更新时间:2022-01-29 22:50:46

jy ***** @ rdss388.tif.ti.com (Jean-Yves Simon)写道:
jy*****@rdss388.tif.ti.com (Jean-Yves Simon) wrote:
index.html的第一个版本是photos.html的链接

hfref =" file:/// c:/siteweb/photos.html"


为什么?除了拼错的属性名称之外,还有一个问题是

你指的是一个带文件的文件:根据定义的URL

强烈依赖于机器。将页面移动到Web上,甚至在您自己的磁盘中移动
时,需要修复此类URL。使用相对网址,例如

href =" photos.html"相反。

我改为href =" c:/siteweb/photos.html&quot ;,然后我收到
错误,说c不是注册协议。


不足为奇。

然后href =" /siteweb/photos.html&quot ;,然后mozilla显示
错误说url siteweb /photos.html不在服务器上。


嗯,是吗?使用的URL是相对于服务器根目录,由基本URL定义的

服务器,***定义。

我确切地说一切都是本地的,要访问我的主页,
The first version of the index.html was a link to the photos.html

hfref="file:///c:/siteweb/photos.html"
Why? Apart from the misspelled attribute name, there''s the problem that
you are referring to a file with a file: URL which is by definition
strongly machine-dependent. When moving pages onto the Web, or even
inside your own disk, such URLs need to be fixed. Use relative URLs like
href="photos.html" instead.
I changed to href="c:/siteweb/photos.html", then I am getting
an error saying the c is not a registered protocol.
Not surprisingly.
Then href="/siteweb/photos.html", but then mozilla displays
an error saying that url siteweb/photos.html is not on the server.
Well, is it there? The URL used is relative to a server root, with the
server defined by the base URL, which had better be defined.
I precise that everything is local, to access my home page,




那么,它不是为WWW创作的,是吗?


-

Yucca, http://www.cs。 tut.fi/~jkorpela/

有关网页制作的网页: http://www.cs.tut.fi/~jkorpela/www.html



Well, then it''s not authoring for the WWW, is it?

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


我相信您没有正确配置您的服务器。

页面单独工作的原因是

您将它们作为本地光盘中的文件加载并绕过

apache。您应该使用localhost / index.html或
http://127.0.0.1/index .html 确保你的服务器运行正常运行



另外,我建议移动你的apache以外的任何网页>
目录作为更安全的做法。让它们都在你的
c:/ siteweb目录下。


祝你好运,

Csaba Gabor


" Jean-Yves Simon" < JY ***** @ rdss388.tif.ti.com>在消息中写道

news:cg ********** @ home.itg.ti.com ...
I believe that you have not configured your server properly.
The reason why the pages are working separately is that
you are loading them as files from your local disc and bypassing
apache. You should use localhost/index.html or
http://127.0.0.1/index.html to make sure that you''ve gotten
your server properly running.
Also, I suggest moving any web pages outside your apache
directory as safer practise. Have them all be under your
c:/siteweb directory.

Good luck,
Csaba Gabor

"Jean-Yves Simon" <jy*****@rdss388.tif.ti.com> wrote in message
news:cg**********@home.itg.ti.com...


我在我的电脑上安装了服务器web apache。 Eveything工作很好,我已经开始创建一些页面了。

在apache的主目录中,我有我的主页。

在c:/ siteweb,我有一个html页面来显示一些图片。

这两个页​​面正确显示。当我想将它们链接在一起时,我遇到了一些问题。

在主页面(index.html)上,我已经放置了一个gif文件,点击后应该是
在siteweb中加载页面。

index.html的第一个版本是photos.html的链接

hfref =" file:/// c :/siteweb/photos.html"
但是当我点击gif文件时,我可以看到mozilla的
状态栏上显示的url,但是当我点击时,没有任何反应。

我改为href =" c:/siteweb/photos.html&quot ;,然后我得到一个错误,说c不是注册协议。

然后href = " /siteweb/photos.html",然后mozilla显示
错误,说url siteweb / photos.html不在服务器上。

我确切地知道一切都是本地的,到访问我的主页,
我输入了mozilla http://10.0.0.1
其中10.0.0.1是我给出的本地IP地址b我的路由器。

提前致谢。

-
Jean-Yves SIMON电子邮件: jy ***** @ tif.ti.com






感谢您的回复。

Jukka K. Korpela(jk******@cs.tut.fi)写道:
Hi,

Thanks for your reply.
Jukka K. Korpela (jk******@cs.tut.fi) wrote:
jy*****@rdss388.tif.ti.com (Jean-Yves Simon)写道:
jy*****@rdss388.tif.ti.com (Jean-Yves Simon) wrote:
index.html的第一个版本是photos.html链接

hfref ="文件:/ //c:/siteweb/photos.html"
为什么?除了拼写错误的属性名称之外,还有一个问题是你指的是一个带有文件的文件:根据定义,URL强烈依赖于机器。将页面移动到Web上,甚至在您自己的磁盘中移动时,需要修复此类URL。使用相对网址,例如
href =" photos.html"代替。


这就是我喜欢做的事情。所以现在,我必须找到在c:/ siteweb路径中引用

的地方,以便在此

路径之后附加photos.html(如果我理解正确的话)。


我改为href =" c:/siteweb/photos.html&quot ;,然后我收到错误说c不是注册协议。
不足为奇。
然后href =" /siteweb/photos.html",然后mozilla显示
错误,说url siteweb / photos.html不在服务器上。
嗯,是吗?使用的URL相对于服务器根目录,其中
服务器由基本URL定义,***定义。


是的,我确定它在那里。

我确切地说一切都是本地的,访问我的主页,
The first version of the index.html was a link to the photos.html

hfref="file:///c:/siteweb/photos.html" Why? Apart from the misspelled attribute name, there''s the problem that
you are referring to a file with a file: URL which is by definition
strongly machine-dependent. When moving pages onto the Web, or even
inside your own disk, such URLs need to be fixed. Use relative URLs like
href="photos.html" instead.
This is what I liked to do. So now, I have to find where to reference
the c:/siteweb path so that photos.html can be appended after this
path (if I understand correctly).

I changed to href="c:/siteweb/photos.html", then I am getting
an error saying the c is not a registered protocol. Not surprisingly. Then href="/siteweb/photos.html", but then mozilla displays
an error saying that url siteweb/photos.html is not on the server. Well, is it there? The URL used is relative to a server root, with the
server defined by the base URL, which had better be defined.
Yes, I am sure it is there.
I precise that everything is local, to access my home page,



那么,它不是为WWW创作的,是吗?


Well, then it''s not authoring for the WWW, is it?




我想在本地测试它,然后再去dyndns和注册

a域名。在本地进行测试不是一个好主意吗?

因为我在nework里面,当我注册了simon.myphotos.cc

我无法访问我的网站。


谢谢和问候

Jean-Yves。



I want to test it locally, before going to dyndns and "register"
a domain name. Is that not a good idea to test it locally ?
because from inside my nework, when I registered simon.myphotos.cc
I could not access my web site.

Thanks and regards
Jean-Yves.