O'Reilly Forums: Html5 Hyperlink Appends Page To The Url - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Html5 Hyperlink Appends Page To The Url

#1 User is offline   robvenable 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 13-October 12

Posted 13 October 2012 - 05:35 AM

Hi,
I have a mobile site that I've been developing in HTML5 with Visual Studio 2010. My default page has 5 links on it that links up to 5 pages on my site.
<ul data-role="listview" data-inset="true">
<li data-role="list-divider">Menu</li>
<li><a href="Services.aspx" data-transition="slide">Services</a></li>
<li><a href="Support.aspx" data-transition="slide">Support</a></li>
<li><a href="Hosting.aspx" data-transition="slide">Web Hosting</a></li>
<li><a href="About.aspx" data-transition="slide">About</a></li>
<li><a href="Contact.aspx" data-transition="slide">Contact</a></li>
</ul>

The problem is, when I click on a link, it appends the page to the url rather than navigating to that page. The page still displays but the url is wrong. So if my url is "http://www.mydomain.com/mobile/default.aspx" and I click on the Services link above, the url changes to "http://www.mydomain.com/mobile/default.aspx#/mobile/Services.aspx". This is just a simple link.
Has anyone ever experienced this behaviour and what can be done to have the correct url come up?

Thanks
0

#2 User is offline   robvenable 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 13-October 12

Posted 15 October 2012 - 05:53 PM

Update,
This in only hapenning on IE9. Works on Firefox and Chrome. This can be viewed at www.codenet.ca/m.
You can see when you click on the buttons on the default page, it appends the page to the existing url with a pound (#) sign.
Has anyone seen this behaviour before?
0

#3 User is offline   AverageJake 

  • Active Member
  • PipPip
  • Group: O'Reilly Author
  • Posts: 36
  • Joined: 04-October 10
  • Gender:Male
  • Location:Seattle, WA

Posted 16 November 2012 - 04:19 PM

View Postrobvenable, on 15 October 2012 - 05:53 PM, said:

Update,
This in only hapenning on IE9. Works on Firefox and Chrome. This can be viewed at www.codenet.ca/m.
You can see when you click on the buttons on the default page, it appends the page to the existing url with a pound (#) sign.
Has anyone seen this behaviour before?


Were you ever able to get this working correctly? Since you're using ASP.NET and jQuery Mobile, there could be a lot of different things going on. It would be nice to try to rule some of them out. Let me know if you're still having this issue and I can try to help you work through it.

Jake
0

#4 User is offline   robvenable 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 13-October 12

Posted 16 November 2012 - 06:56 PM

Hi Jake,
Yes I did get this working. Apparently this is the behaviour of jquery mobile so what you have to do is set an attribute of data-ajax="false" in the link and that will take care of it. Or, you can put it in your form element and it will do it for the entire page.
<form id="form1" runat="server" data-ajax="false">

Rob
0

#5 User is offline   Indianic 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 26-December 12
  • Gender:Male
  • Location:India

Posted 15 February 2013 - 03:43 AM

Thanks for sharing the information. It is really informative and useful.


Android App Developer | Android game Development
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users