Reputation: 1528
Using jQuery Mobile with ThemeRoller theme, the accordion menu delivers a URL with hash when "Cake Sizes" is clicked. The ThemeRoller theme does not load with has in URL.
<div><h3><a href="#">Cakes</a></h3>
<div id="accordion-child">
<div><h3><a href="/cakes/cake-sizes" data-transition="slideup">Cake Sizes</a></h3></div>
<div><h3><a href="/cakes/flavors">Flavors</a></h3></div>
<div><h3><a href="/cakes/gallery">Gallery</a></h3></div>
</div>
</div>
When click "Cake Sizes" URL is http://example.com/#/cakes/cake-sizes
How do I prevent # from ending up in URL or how do I remove it? Does anyone know why Themeroller theme will not load with hash in URL?
Upvotes: 0
Views: 438
Reputation: 955
By default jquery mobile using ajax calls to load pages. So the "#" included automatically in the url. To avoid that,use
data-ajax="false"
to disable ajax call on the hyperlinks. And try like this
<div><h3><a href="#" data-ajax="false">Cakes</a></h3>
Hope it works...
Upvotes: 0
Reputation: 46788
Why do you have the #
in the href
for cakes anyway. Leave it blank and it will behave in the same manner.
Upvotes: 0