1

I am having a great deal of difficulty getting the childBrowser plugin to work

Currently when I click my link it does nothing on my iOS simulator and when I click it using a browser I get a Web Page Not Found error with the web address looking something like:

file://myapp/www/%C3%A2%E2%82%AC%C2%9D#ᅢᄁ¬ツᆲᅡン

I am really stuck for ideas on whats going on and what is causing this, any advice would be greatly appreciated.

My code is:

<script type="text/javascript" charset="utf-8" src="js/ChildBrowser.js"></script>
        <script>
            function onDeviceReady() {
                childbrowser = ChildBrowser.install();
                var root = this;
                cb = window.plugins.childBrowser;

                if(cb != null) {
                    cb.onLocationChange = function(loc){ root.locChanged(loc); };
                    cb.onClose = function(){root.onCloseBrowser(); };
                    cb.onOpenExternal = function(){root.onOpenExternal(); };
                    //cb.showWebPage(“http://google.com”);
                                   }
                                   }

                                   function onCloseBrowser() {
                                   console.log(“onCloseBrowser!”);
                                   }

                                   function locChanged(loc) {
                                   console.log(“locChanged!”);
                                   }

                                   function onOpenExternal() {
                                   alert(“onOpenExternal!”);
                                   }        

<body onLoad=”onBodyLoad()”>
<a href=”#” onclick=’cb.showWebPage(“http://www.google.com”);’>Click Me</a>
MeltingDog
  • 14,310
  • 43
  • 165
  • 295

1 Answers1

1

It is difficult to get which part of the app is doing wrong as given source is not enough. I have a small demo application which just uses childbrowser with cordova 1.7.0 which you can check to make sure the source is unaltered.

ios-cordova-childbrowser example

dhaval
  • 7,611
  • 3
  • 29
  • 38
  • Thanks that example is great. I missed a lot of steps in my initial install - mostly because I have never done an plugin installation before let alone an app. I also found the example index.html page that comes with the childBrowser download helpful. After I did the install I reverse engineered that page. – MeltingDog Jul 05 '12 at 00:04