2011-04-16 48 views
2

我有幾個移動網頁。其中有幾個是從同一個文件(index.php)內部鏈接並且工作正常。例如:#first到#second和#second到#third。當我到達#third並將表單查詢提交到外部文件process.php(它位於同一目錄中)時,問題就出現了。我可以很好地訪問process.php文件,但我需要在此頁面上插入一個超鏈接來鏈接回原始頁面(#first index.php內)。我嘗試了幾個建議,但不管我做了什麼瀏覽器似乎追加index.php的URL,所以實際上把我帶回#third而不是#first。jQuery Mobile的內部/外部鏈接問題

EG:http://localhost/website/third.php#index.php

我曾嘗試:

<a href="index.php">Clicky</a> 
<a href="#first">Clicky</a> 
<a href="/website/index.php">Clicky</a> 
<a href="..index.php">Clicky</a> 
<a href="http://localhost/website/index.php">Clicky</a> 

似乎都讓我回到與任何我已經要求在年底被帶到一個附加#後面的第三頁網址。有任何想法嗎?

回答

3

你必須鏈接到jQuery Mobile的外部網頁時指定rel="external"

<a href="index.php#first" rel="external">Clicky</a> 

該鏈接假定index.phpSAME目錄process.php。如果不是,則必須稍微修改路徑才能工作。

+0

嗨。感謝您的迴應。是的,我試過了,它將我帶到以下URL:localhost/website/process.php#index.php#first – Seven 2011-04-16 20:50:40

+0

嘗試Clicky 2011-04-16 20:53:16

+0

謝謝。這工作。必須改變一些其他內部鏈接來完成目錄鏈接,但現在全部鏈接在一起。好東西。 – Seven 2011-04-16 22:20:03