Tag: external links

PhoneGap for iPhone:加载外部URL时出现问题

我正在使用PhoneGap为iPad编写应用程序,我希望加载外部URL而不触发Safari或使用内部networking浏览器(如ChildBrowser)。 我正在使用PhoneGap iPad / iPhone示例项目,并尝试了不同的方法。 在onBodyLoad()函数中我添加了: window.location.href('http://www.wordreference.com'); 但这一行使用新的Safari窗口打开链接。从这一点是不可能回到PhoneGap 之后,我尝试使用document.writereplace页面内容的AJAX请求 function loadHTML(url, timeout) { if (timeout == undefined) timeout = 10000; var req = new XMLHttpRequest(); var timer = setTimeout(function() { try { req.abort(); } catch(e) {} navigator.notification.loadingStop(); },timeout); req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status < 300) { clearTimeout(timer); var html […]