external-links

PhoneGap for iPhone: problem loading external URL

二次信任 提交于 2019-11-26 15:56:21
I'm writing an application for iPad using PhoneGap and I would like to load an external URL without triggering Safari or using internal web browser like ChildBrowser. I'm using the PhoneGap iPad/iPhone sample project and I tried different approaches. In the onBodyLoad() function I added: window.location.href('http://www.wordreference.com'); but this line opens the link using a new Safari window.From that point is not possible to come back in PhoneGap Afterwards, I tried with an AJAX request substituting the content of the page using document.write function loadHTML(url, timeout) { if (timeout

How do I add target=“_blank” to a link within a specified div?

久未见 提交于 2019-11-26 06:29:43
问题 Let\'s say I have the following code: <div id=\"link_other\"> <ul> <li><a href=\"http://www.google.com/\">google</a></li> <li> <div class=\"some_class\"> dsalkfnm sladkfm <a href=\"http://www.yahoo.com/\">yahoo</a> </div> </li> </ul> </div> In this case, the JavaScript would add target=\"_blank\" to all links within the div link_other . How can I do that using JavaScript? 回答1: /* here are two different ways to do this */ //using jquery: $(document).ready(function(){ $('#link_other a').attr(

PhoneGap for iPhone: problem loading external URL

我只是一个虾纸丫 提交于 2019-11-26 04:39:34
问题 I\'m writing an application for iPad using PhoneGap and I would like to load an external URL without triggering Safari or using internal web browser like ChildBrowser. I\'m using the PhoneGap iPad/iPhone sample project and I tried different approaches. In the onBodyLoad() function I added: window.location.href(\'http://www.wordreference.com\'); but this line opens the link using a new Safari window.From that point is not possible to come back in PhoneGap Afterwards, I tried with an AJAX