locked
Anchor tags are not working on internet explorer when using touch devices RRS feed

  • Question

  • Hi,

    I have a simple anchor tag like <a href=http://www.google.com></a>

    Using a mouse there is no problem but when I use a touch device (windows 8.1/windows Phone 8.1), all that will happen when people touch it is that the link will be highlighted. I don't want to highlight it, I just want the link to open.

    Double clicking the link will zoom in the page. It takes several attempts tapping the link to actually open it... this is VERY frustrating.

    How can I remove this highlighting non-sense?

    I found an article that seems to indicate this was done on purpose:

    http://blogs.msdn.com/b/ie/archive/2013/07/31/ie11-touch-browsing-for-today-s-web-and-beyond.aspx

    It's a total failure if you ask me and it is very frustrating to use my site on a touch device.

    Anyone has any idea on how to make links behave normally?

    Best Regards,

    Peter

     

    Thursday, August 21, 2014 5:46 AM

All replies

  • Some more information...

    I'm experiencing this problem with a SharePoint site. I have another SharePoint site which is quite similar and that doesn't have this problem at all. Both SharePoint sites are in different site collections, but they both use the same OSLO base template.

    So it seems that it is something in SharePoint that is causing this behavior

    I just can't find any reason why this is happening

    Does anybody have any experience with this problem within SharePoint?

    Best Regards,

    Peter

    Thursday, August 21, 2014 6:52 AM
  • seems that it is something in SharePoint that is causing this behavior

    So you would probably be better off posting in a Sharepoint forum.  They would be more familiar with all the products involved.  This is an example where newsgroup cross-posting would be useful but it does not exist in forums.

    Otherwise, sounds like you are going to have to find the implementation involved and then devise a workaround for it.  Is there a publicly accessible example of the coding used for what you are seeing?  You could use the Developer Tools (or View Source) to try to look at it yourself.

    For a guess it may involve Active Scripting.  If the link can be used even if Active Scripting is disabled you could achieve that result simply by changing the security level or zone that the site is regarded with.

    BTW with your example link above I have the opposite problem.  I can't touch it to try to select it without launching it.  Here's a workaround for that:  select a word before the link, use the selection's wheels to extend it to include the link, then reduce it to include only the link, then, I can use press and old on the selection without launching the link.  (In fact since I always leave press and hold disabled I used my pen with its right-click barrel button to see the selection's menu though if I use my pen's barrel button, I don't need to make the selection to see just a reduced menu which would be sufficient to use the link.)  In any case, I imagine that just as I can do a press and hold on the selected text of the link without launching it you may just as easily be able to do a press and hold to see the selection's menu to allow you to launch its link.  

     

    HTH



    Robert Aldwinckle
    ---

    Thursday, August 21, 2014 5:16 PM
    Answerer
  • Hi Robert,

    I already posted it in SharePoint. I did find a workarround... I can simply use the onclick event in combination with setting the href on the anchor.

    This enables desktop and touch screen scenario... as long as JavaScript is enabled... but then again, does anybody really tries to run SharePoint without JavaScript?

    It is still a pain to have to go through and a maintenance nightmare in the making.

    I would appreciate a better solution.

    Best regards,

    Peter

    Thursday, August 21, 2014 5:26 PM
  • I would appreciate a better solution.

    So does press and hold on the link's selection give you a menu or not?


    Robert Aldwinckle
    ---

    Thursday, August 21, 2014 5:53 PM
    Answerer
  • yes it does...

    But there is no option to execute the link as far as I remember.

    Peter

    Thursday, August 21, 2014 7:16 PM
  • Hi Peter,

    different IE versions treat white space differently... hyperlinks should work on both touch and non-touch devices, and they do...

    a HYPERLINK like <a href="http://gooooogle.com/">google</a> should work...

    whereas <a href="http://gooogle.com/"> </a> (depending on your IE version and compatibility view settings) won't work because either the white space is ignored (treated as a textnode) or the rendered size of the empty link is too small to register a click event from a meatstick.

    Post questions about html, css and scripting for web site developers to the IE Web Development forum. Include with your questions a link to your website or a publicly accessible mashup that shows the issue... We need to see your complete page markup and server response headers to make a diagnosis.

    This forum is for

    Questions regarding Internet Explorer 8, 9 and 10 and Internet Explorer 11 for the IT Pro Audience. Topics covered are: Installation, Deployment, Configuration, Security, Group Policy, Management questions. If you are a consumer looking for answers or to raise a question, it's highly recommended you head on over to http://answers.microsoft.com


    Rob^_^

    Friday, August 22, 2014 1:15 AM
  • yes it does... 

    Ok.  Let's look at your example link above.  When you press and hold a selection in it do you see an action menu?  Are you implying there is a different menu for the Sharepoint example?  Have you looked at the source for both?  What you are describing could happen.  You just need to figure out the best workaround to deal with the facts.  As I indicated I think making a partial selection within the link's text is likely to be the easiest most controllable method, certainly much more reliable than your current procedure.   <eg>



    Robert Aldwinckle
    ---

    Friday, August 22, 2014 3:05 AM
    Answerer
  • Sorry Robert, you are right... there is an option to open in other page.

    But this is not really in line with what users expect to click a link.... they don't want to long press a link in order to open it. At the very least it is not intuitive.

    Your solution seems to indicate we need to explain the user how to actually use a website in a different way then what that user does normally. That's not a good solution to me.

    My current solutions seems to work on all windows devices I have been able to try.

    Best Regards,

    Peter

    Friday, August 22, 2014 8:13 AM
  • Hi Rob,

    The link I provided was an example... of course there is always a text between the <a></a> tags.

    As for me posting in this forum... at the time of posting I didn't know the problem was only hitting one of my SharePoint sites and not the others. So I was thinking this was more of a generic problem with IE itself, which clearly doesn't seem to be the case.

    I think this is a SharePoint issue and that's why I have also posted the issue over there.

    Best Regards,

    Peter

    Friday, August 22, 2014 8:39 AM
  • Hi,

    How's everything going?

    If you got any progresses about this, it would be wonderful that you could share it with us.

    Regards


    Yolanda Zhu
    TechNet Community Support

    Wednesday, September 10, 2014 2:41 AM
  • Hi Yolanda,

    I worked arround the problem by adding a javascript to the onclick event that will navigate to the url. It seems the javascript does execute, whereas the href itself is ignored on touch screens. By setting href and onclick on each anchor I'm hoping to avoid any downsides for desktop users. It is a hack at best... so i would still like to hear it if there's another way.

    I must say I'm very surprised that such basic functionality is not working normally or has to be addressed in this way.

    Best Regards,

    Peter

    Wednesday, September 10, 2014 5:36 AM