This recipe shows you how to use the utility methods provided by the $.mobile.path
object in your app.
Copy the full code of this recipe from the code/09/path
source folder. You can launch this code by using the URL: http://localhost:8080/09/path/main.html
.
Create the
main.html
page with four anchor links, as shown in the following code snippet:<div data-role="content"> <div id="msgdiv"></div> <a href="http://localhost:8080/09/base/main.html" data-role="button"> 1: http://localhost:8080/09/base/main.html </a> <a href="http://localhost:8080/09/base/" data- role="button"> 2: http://localhost:8080/09/base/ </a> <a href="page1.html" data-role="button"> 3: page1.html </a> <a href="../" data-role="button">4: ../</a> </div>
Add the following script to the
<head>
section to get the URL of the link clicked.$("#main").live("pageinit...