0

Using jQuery Mobile, how could I create hashbang URLs such as #!/value_1/value_2 and be able to read both of these values, assuming that both parameters will always be in the same order.

One caveat is that this is being powered by a one page structure, so I'm not linking to an external page.

Kevin Brown-Silva
  • 39,112
  • 40
  • 199
  • 230
James
  • 5,116
  • 5
  • 38
  • 78
  • 1
    This question might help you out - http://stackoverflow.com/questions/6629776/jquery-mobile-and-query-parameters-for-hashbang-navigation – slandau Jul 18 '11 at 14:49

1 Answers1

0

jQuery Mobile automatically maps hashbangs to page element ids (faux pages) by default. First you need to disable this behavior.

Then you need have a custom logic which reads windows.location.hash and takes action on it either when

  • the site is loaded

  • individual faux page is openend (onpageshow JQM event)

Creating links happens like you would create links normally - just set a href value.

Here is more info:

jQuery Mobile and "query parameters" for hashbang navigation

Community
  • 1
  • 1
Mikko Ohtamaa
  • 76,495
  • 46
  • 227
  • 378