0

i want to open a link in a view,something like http://google.com . i tried it with iframe src="" but when i run it on iphone it opens in webview so i unable see header and footer.

 <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>

when i open this page it directly opens google in a webview, my intention is to open when i click 'yyy'. i need it to run in iphone also.

tiru
  • 789
  • 5
  • 20
  • 42
  • by following this link for iPhone phonegap solved. [Follo Link][1] [1]: http://stackoverflow.com/questions/5911255/phonegap-for-iphone-problem-loading-external-url/7779187#7779187 – tiru Apr 14 '12 at 10:41

2 Answers2

0

Download the content of url and on button click load in view

    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

if you can use javascript, try with

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

in your html will be:

<iframe width="100%" height="100%" frameborder="0" scrolling="no" marginheight="0"
                marginwidth="0" onclick="window.open("www.google.com")">
Víctor
  • 3,029
  • 3
  • 28
  • 43
  • onclick property not finding. and here if i use onclick for an anchor it opens the link fine, but it opens in new web view not in my page which is decorated with footer and header. – tiru Apr 09 '12 at 14:06