frame src属性中的绝对路径问题 [英] Absolute Path issue in frame src attribute

查看:138
本文介绍了frame src属性中的绝对路径问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用frameset。当src属性设置为绝对路径时,框架无效。



 <   frameset     cols   =  100% > ;  
<% - < frame src = H:/Projects/WebSite1/images/IMG_haefelelogo.gif name = frame_a> - %>
<% - < frame src = H:\Projects \WebSite1 \ images'\\IMG_haefelelogo.gif name = frame_a> - %>
< / frame >







请做。

解决方案

你不应该这样做。如果你在任何地方发布你的网站它会破坏。

你应该总是使用相对路径。

src属性由客户端(例如浏览器)解析无法访问绝对路径。



看着你的路径,你的网站是在H:\Projects \Website1。

所以图像在图像文件夹中。



路径应该是相对的和实际的URL,所以使用正斜杠。



 <   frame     src   =  images / IMG_haefelelogo.gif    name   =  frame_a >  





希望这会有所帮助。



但是我会注意到框架集不再是HTML规范的一部分,并且可能会在未来的某些现代浏览器中删除支持


I am using frameset .But frame is not working when its src attribute set to absolute path.

<frameset cols="100%">
<%--<frame src="H:/Projects/WebSite1/images/IMG_haefelelogo.gif" name="frame_a">--%>
<%--<frame src="H:\Projects\WebSite1\images\IMG_haefelelogo.gif" name="frame_a">--%>
</frame>




Please do needful.

解决方案

You shouldn't do this. If you publish you're site anywhere it will break.
You should always use a relative path.
The src attribute is resolved by the client (e.g. the browser) which doesn't have access to the absolute path.

Looking at you're path you're website is in H:\Projects\Website1.
So the images are in the image folder.

The paths should be relative and actual url's so with forward slashes.

<frame src="images/IMG_haefelelogo.gif" name="frame_a">



Hope this helps.

I will however note that framesets are no longer part of the HTML spec and support will probably be dropped in some future modern browsers


这篇关于frame src属性中的绝对路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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