javascript中的相对路径和绝对路径之间的差异 [英] Difference between Relative path and absolute path in javascript

查看:155
本文介绍了javascript中的相对路径和绝对路径之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有小小的澄清,



据我所知,这些是相对的和绝对的路径,

 完全相对:< img src =kitten.png/> 
绝对在所有方面:< img src =http://www.foo.com/images/kitten.png>

相对路径和绝对路径有什么区别?



使用这些路径时是否出现任何性能问题?



我们会为这些网站获得任何安全性吗?



有任何方法将绝对路径转换为相对的

解决方案


相对路径和绝对路径之间的差异?


必须根据另一个URI计算。


使用这些路径时是否出现任何性能问题?



<

没有什么意义。


我们会为这些网站获得安全吗?



有无法将绝对路径转换为相对

简化术语:从左到右依次尝试匹配方案,主机名,然后使用您尝试相对的URI的路径段。当您有比赛时停止。


Have small clarifications,

As of my knowledge these are the relative and absolute paths,

Completely relative: <img src="kitten.png"/>   
Absolute in all respects: <img src="http://www.foo.com/images/kitten.png">

What is the difference between Relative path and absolute path?

Is there any performance issues occures for using these paths?

We will get any secure for the sites ?

Is there any way to converting absolute path to relative

解决方案

What is the difference between Relative path and absolute path?

One has to be calculated with respect to another URI. The other does not.

Is there any performance issues occures for using these paths?

Nothing significant.

We will get any secure for the sites ?

No

Is there any way to converting absolute path to relative

In really simplified terms: Working from left to right, try to match the scheme, hostname, then path segments with the URI you are trying to be relative to. Stop when you have a match.

这篇关于javascript中的相对路径和绝对路径之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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