Child browser plugin in phonegap 1.7 can open only for the first time

195 views
Skip to first unread message

Jove

unread,
May 17, 2012, 8:30:19 PM5/17/12
to phon...@googlegroups.com

Hi

I'm using phonegap 1.7 and child browser plugin. only for the first time child browser is working. After I closed the childbrowser(pressed done button) its not opening again when I tried to open it.

My code is this:

$("a[target=_blank]").bind('click', function(e) {
    e
.preventDefault();
   
var thisUrl = $(this).attr('href');
    cb
.showWebPage(thisUrl);
    alert
("click");
});

When I click a link, child browser pop and show the page, I click "Done" and return, but when I click the link again or another link, child browser can't pop any more, but the alert "click" show every time.

p.s. I downloaded child browser plugin from here: https://github.com/phonegap/phonegap-plugins/tree/master/iOS/ChildBrowser

Jove

unread,
May 18, 2012, 3:30:24 AM5/18/12
to phon...@googlegroups.com
Dose child browser plugin support phonegap 1.7?

Jove

unread,
May 18, 2012, 9:41:30 AM5/18/12
to phon...@googlegroups.com
Anyone use child browser plugin in phonegap 1.7?

JB_APP

unread,
Jun 19, 2012, 5:59:50 AM6/19/12
to phon...@googlegroups.com
Hello,
I am using Phonegap 1.8.1 and I can report the same problem. Anyone with a solution for this problem?

anurag gautam

unread,
Jun 19, 2012, 6:06:41 AM6/19/12
to phon...@googlegroups.com

hello

 always intialise the ChildBrowser.install();

Then its working fine,


function openBrowser(url){

    childBrowser = ChildBrowser.install();

 window.plugins.childBrowser.showWebPage(url);

}

happy coding :)
please revert 

On Tue, Jun 19, 2012 at 3:29 PM, JB_APP <in...@images-words.de> wrote:
Hello,
I am using Phonegap 1.8.1 and I can report the same problem. Anyone with a solution for this problem?

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com



--
Thanks!
With regards
ANURAG GAUTAM
7814155605
Linkedin profile


JB_APP

unread,
Jun 19, 2012, 8:18:16 AM6/19/12
to phon...@googlegroups.com
Hello again,
I tried to follow your instructions and initialized every call of the childbrowser but with the same effect. It still only fires once. 

anurag gautam

unread,
Jun 19, 2012, 8:20:14 AM6/19/12
to phon...@googlegroups.com
 for what platform u are working ?

On Tue, Jun 19, 2012 at 5:48 PM, JB_APP <in...@images-words.de> wrote:
Hello again,
I tried to follow your instructions and initialized every call of the childbrowser but with the same effect. It still only fires once. 

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com

anurag gautam

unread,
Jun 19, 2012, 8:21:30 AM6/19/12
to phon...@googlegroups.com
can u post a code, 

its working fine  for iphone as well as on android 

JB_APP

unread,
Jun 19, 2012, 8:32:44 AM6/19/12
to phon...@googlegroups.com
Perhaps later, since I have the code on another machine.
The call itself of  the function "openBrowser" works fine. I can put an alert "hello World" and it will be displayed, everytime I call the function but the opening of the Childbrowser works only one time.


Am Dienstag, 19. Juni 2012 14:21:30 UTC+2 schrieb anurag gautam:
can u post a code, 

its working fine  for iphone as well as on android 

On Tue, Jun 19, 2012 at 5:50 PM, anurag gautam <anuragg...@gmail.com> wrote:
 for what platform u are working ?
On Tue, Jun 19, 2012 at 5:48 PM, JB_APP <in...@images-words.de> wrote:
Hello again,
I tried to follow your instructions and initialized every call of the childbrowser but with the same effect. It still only fires once. 

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
--
Thanks!
With regards
ANURAG GAUTAM
7814155605
Linkedin profile





--
Thanks!
With regards
ANURAG GAUTAM
7814155605
Linkedin profile



Am Dienstag, 19. Juni 2012 14:21:30 UTC+2 schrieb anurag gautam:
can u post a code, 

its working fine  for iphone as well as on android 

On Tue, Jun 19, 2012 at 5:50 PM, anurag gautam <anuragg...@gmail.com> wrote:
 for what platform u are working ?
On Tue, Jun 19, 2012 at 5:48 PM, JB_APP <in...@images-words.de> wrote:
Hello again,
I tried to follow your instructions and initialized every call of the childbrowser but with the same effect. It still only fires once. 

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
--
Thanks!
With regards
ANURAG GAUTAM
7814155605
Linkedin profile


JB_APP

unread,
Jun 19, 2012, 8:37:51 AM6/19/12
to phon...@googlegroups.com
here some code....


$(document).ready(function() {

    document.addEventListener("deviceready", onDeviceReady, false);
                   
    window.addEventListener("resize", orientationChange, false);
                  
    function openBrowser(url){
                  alert ('open');
        childBrowser = ChildBrowser.install();
        window.plugins.childBrowser.showWebPage(url);
    }
........


and the call itself comes here:
    $('#goto_help').click(function() {
                          alert ('help');
                          openBrowser('http://www.google.de');

    });

JB_APP

unread,
Jun 19, 2012, 8:43:37 AM6/19/12
to phon...@googlegroups.com
I also get this messages in the log file, when I close the ChildBrowser (when it open the one time)

2012-06-19 14:40:57.796 Test-App[1098:13403] The view controller <ChildBrowserViewController: 0x9246350> returned NO from -shouldAutorotateToInterfaceOrientation: for all interface orientations. It should support at least one orientation.
2012-06-19 14:40:57.801 Test-App[1098:13403] New Address is : about:blank

anurag gautam

unread,
Jun 19, 2012, 8:50:21 AM6/19/12
to phon...@googlegroups.com
yes track the error,

Never use
 $(document).ready(function() { }); 
function for jquery mobile or in phonegap, its working on Web base application

use this function 

$('#pageid').live('pagebeforeshow',function(){  });

  try it will works..



..





--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com

JB_APP

unread,
Jun 19, 2012, 9:23:11 AM6/19/12
to phon...@googlegroups.com
I changed the document ready function to pageid......... it works but the child browser problem  is still the same. The log messages have to do with the orientations I defined for the app. If I allow all orientations, the error in the log disapears. But also here, the child browser still opens only at the first time.

JB_APP

unread,
Jun 19, 2012, 9:40:04 AM6/19/12
to phon...@googlegroups.com

ConchitaBH

unread,
Jun 19, 2012, 10:40:33 AM6/19/12
to phon...@googlegroups.com
I have problems too with childbrowser and ios5, im using cordova 1.8,
in ios4 works fine, but when i try to use childbrowser in ios5 i saw
the console and there was an exception

2012/6/19 JB_APP <in...@images-words.de>:
> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com



--
Ing. Concepción Bautista H
Reply all
Reply to author
Forward
0 new messages