有写href的兼容方法吗? [英] Is there a compatible way to write href?

查看:91
本文介绍了有写href的兼容方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,在文件test.php中:

<a href="someting/?start=1">go</a>;

,因此无论此test.php在何处,无论是在Document_Root/Test/目录中还是在Document_Root/Production/目录中,锚点都将指向其自身.

so that no matter where this test.php is, whether in Document_Root/Test/ directory or in Document_Root/Production/ directory, the anchor will point to itself.

推荐答案

要编写仅更改查询字符串的链接,只需使用

To write a link that will only change the query string, just use

<a href="?foo=bar">whatever</a>

因此,如果您位于http://the/current/url.php,它将转到http://the/current/url.php?foo=bar,或者如果您位于http://somewhere/else?entire=ly,它将转到http://somewhere/else?foo=bar.

So if you're at http://the/current/url.php, it goes to http://the/current/url.php?foo=bar, or if you're http://somewhere/else?entire=ly, it goes to http://somewhere/else?foo=bar.

这篇关于有写href的兼容方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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