如何打开手机视图中的链接?

问题描述:

我想在视图中打开链接,例如http://google.com。我试过用iframe src =“”但是当我在iphone上运行它时,它在webview中打开,所以我无法看到页眉和页脚。如何打开手机视图中的链接?

<div data-role="view" data-layout="overview-layout" data-title="More">  
    <div data-role="content" > 
     <div class="km-scroll-container" > 
      <ul id="menuList" class="item-list km-listview km-listgroup"> 
       <li> 
        <ul data-role="listview"> 
         <li><a class="details-link" data-role="listview-link" href="">xxx</a></li> 
          <li><a class="details-link" data-role="listview-link" href="#moreinfo">yyy</a></li> 

         <li></li> 

        </ul> 
       </li> 
      </ul> 
     </div> 
    </div>   
</div> 

    <div data-role="view" data-layout="overview-layout" id="moreinfo" data-title="More Info"> 
    <div data-role="content"> 
     <div class="km-scroll-container"> 
      <iframe width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0" 
       marginwidth="0" src="http://www.google.com"> 
      </iframe>  
     </div> 
    </div> 

当我打开此页面时,它直接在webview中打开谷歌,我的意图是打开时,我点击'yyy'。我需要它也运行在iPhone上。

+0

通过以下链接为iPhone phonegap解决。 [弗洛链接] [1] [1]:http://*.com/questions/5911255/phonegap-for-iphone-problem-loading-external-url/7779187#7779187 – tiru 2012-04-14 10:41:43

下载地址在视

NSData *d = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.google.com"]]; 
    NSString *s = [[NSString alloc] initWithData:d encoding:NSUTF8StringEncoding]; 
    //load string s in view 
    textView.text = s; 
+0

我是不是一个iphone开发者,并且需要它在html页面中工作并使用kendoui。 – tiru 2012-04-09 07:00:40

的内容和按钮点击负荷,如果你可以使用JavaScript,请尝试使用

window.open("www.google.com"); 

在你的HTML将是:

<iframe width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0" 
       marginwidth="0" onclick="window.open("www.google.com")"> 
+0

onclick属性找不到。在这里,如果我使用onclick作为锚点,它会打开链接正常,但它会在新的Web视图中打开,而不是在装有页脚和页眉的页面中。 – tiru 2012-04-09 14:06:37