2011-09-06 162 views
0

在這個URL
boiseresturants.com/mexican/baja-fresh-mexican-grill.html錨鏈接

我有一個錨鏈接,看起來像

<a href="#takemehere">his is a test</a> 

現在,我希望上面的鏈接顯示爲
boiseresturants.com/mexican/baja-fresh-mexican-grill.html#takemehere

卻道出了
boiseresturants.com/#takemehere

這究竟是爲什麼?我從來沒有見過這樣的事情。

+2

[格式化幫助](http://stackoverflow.com/editing-help)。 – alex

+0

在您的問題中選擇代碼並單擊「代碼」(看起來像雙引號)以正確顯示代碼。或者將代碼置於反引號(通常在Tab鍵上方的鍵)。 –

回答

0

它跳轉到主頁的原因是因爲該頁面已在<head><base>集:

<base href="http://www.boiseresturants.com/" /> 

要麼丟棄或更具體與您的錨像這樣:

<a href="/mexican/baja-fresh-mexican-grill.html#takemehere">Take Me Here</a> 
0

base因素導致意料之外的行爲......

<base href="http://www.boiseresturants.com/" /> 

你需要使用的完整路徑。