开发者

Internal / External Link Issue with jQuery Mobile

开发者 https://www.devze.com 2023-02-25 02:43 出处:网络
I have a few mobile web pages. Several of them are internally linked from the same file (index.php) and work fine. Eg: #first to #second and #second to #third. The problem comes when I get to #third开

I have a few mobile web pages. Several of them are internally linked from the same file (index.php) and work fine. Eg: #first to #second and #second to #third. The problem comes when I get to #third开发者_StackOverflow社区 and submit a form query to an external file process.php (which is located in a same directory). I can get to the process.php file fine but I need to insert a hyperlink on this page to link back to the original page (#first inside index.php). I have tried several suggestions but no matter what I do the browser seems to append index.php to the URL so is actually bringing me back to #third rather than #first.

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

I have tried:

<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>

All seem to bring me back to the third page with whatever I've requested to be brought to appended after a # at the end of the URL. Any ideas?


You have to specify rel="external" when linking to external pages in jQuery Mobile:

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

That link assumes that index.php is in the SAME directory as process.php. If it isn't, you'll have to modify the path slightly to work.

0

精彩评论

暂无评论...
验证码 换一张
取 消