This is a migrated thread and some comments may be shown as answers.

How to open links externally

5 Answers 237 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Robin
Top achievements
Rank 1
Robin asked on 18 Apr 2013, 05:53 PM
Using Kendo UI Mobile v2013.1.319 and PhoneGap 2.6.0 (iOs), I'm no longer able to open links in the Safari browser.

This worked well on previous versions:
<a href="http://apache.org" data-rel="external" target="_blank">

But now it still opens in the same webview as the app itself. 

Any tips how to force the links to open externally? Preferably without using javascript.  

5 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 22 Apr 2013, 07:36 AM
Hi Robin,

I think that the problem might be related to a specific phonegap behavior. Can you please check this article and see if the suggestions listed in it work for you? 

Kind regards,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Robin
Top achievements
Rank 1
answered on 22 Apr 2013, 12:00 PM
It seems the only way to do it is to use javascript and window.open - to either launch the browser or the InAppBrowser (simply adding "target=_blank" doesn't work).

Perhaps for future releases of Kendo UI Mobile you could make this happen automatically depending on the target attribute of the anchor element. For example if the target is "_blank" or "_iab" it calls the window.open and makes the page load in the InAppBrowser.

We tried different solutions for overriding the a click event, but found none that worked 100%. 
0
Petyo
Telerik team
answered on 24 Apr 2013, 07:37 AM
Hello Robin,

Thank you for your suggestion. I am not sure if we should assume and hard-code the external links behavior on behalf of the application developer, though. From what I see, PhoneGap is also not sure what people expect to happen when a link with target="_blank" is clicked, hence the abundance of discussions (and solutions) available as google results.

If you discover that Kendo UI Mobile is somehow interfering with the suggested solutions (e.g. a solution works in a regular web page with links in it, but does not work with data-rel="external" links when a Kendo UI Mobile app is instantiated), please let us know. We will do our best to help. 

All the best,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Brian
Top achievements
Rank 1
answered on 16 Jan 2014, 02:25 PM
I'm experiencing this issue as well.  The link that you said to look at no longer exists.  Has any concrete solution for this been determined?  
0
Petyo
Telerik team
answered on 20 Jan 2014, 07:36 AM
Hello Brian,

This is the article which I linked to originally. 

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Robin
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Robin
Top achievements
Rank 1
Brian
Top achievements
Rank 1
Share this question
or