This is a migrated thread and some comments may be shown as answers.

Plugins/Child Browser/childbrowser.js doesn't work

7 Answers 49 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Larry
Top achievements
Rank 1
Larry asked on 21 Nov 2012, 08:23 PM
Below is my code. Clicking doesn't open childbrowser. No errors or warnings during compile. Please provide working sample of childbrowser example

<!DOCTYPE html>
<html>
<head>
<title>Notification Example</title><script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8" src="Plugins/Child Browser/childbrowser.js"></script><script type="text/javascript" charset="utf-8">// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);// Cordova is ready
//
function onDeviceReady() {
// Empty
 
}// alert dialog dismissed
function alertDismissed() {
// do something
}       
// Show a custom alertDismissedfunction openUrl() {       
    window.plugins.childBrowser.showWebPage("http://www.google.com", { showLocationBar: true });      
 }
        
        //
function showAlert() {
navigator.notification.alert(
'Some message', // message
alertDismissed, // callback
'Application Title', // title
'Close' // buttonName
);
}</script>
</head>
<body>
<p><a href="#" onclick="showAlert(); return false;">Show Alert</a></p><p><a href="#" onclick="openUrl(); return false;">Open Google</a></p>
   
</body>
</html>

7 Answers, 1 is accepted

Sort by
0
Jan-Dirk
Top achievements
Rank 1
answered on 22 Nov 2012, 12:19 PM
Have you been testing in the simulator or on a device? If I recall well, someone from Icenium mentioned that the Childbrowser doesn't work on the simulator.
0
Larry
Top achievements
Rank 1
answered on 26 Nov 2012, 12:42 PM
No, I am not using the simulator because as you mentioned, ChildBrowser does not work in the simulator. I tried this on iPad as well as on Android and neither of them worked.

Please let me know if you see any problem in my code or post a working solution.

Thank you.
0
fan
Top achievements
Rank 1
answered on 26 Nov 2012, 01:56 PM
hi, i have similar problem.

The error is 
"Failed to load resource  http://local/Plugins/Child%20Browser/childbrowser.js"

i am think it is caused by the "space" in the path? But I can't rename this file.

Anyone has some advice to solve it?

thank you in advance
0
Ivan Ivanov
Telerik team
answered on 27 Nov 2012, 04:18 PM
Hello Martin,

Your code looks fine. You could try removing your application and deploy it again on the device. Plugins should work for android devices and for provisioned iOS devices. Currently cordova plugins does not work in Ion on iOS devices.
 
Additionally we created a sample that uses child browser as you suggested. You can clone it from here - https://github.com/Icenium/sample-childbrowser.git

 I hope this information will help you solve the problems you are experiencing. If you still experience any issues, please write us back.

All the best,
Ivan Ivanov
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
0
Larry
Top achievements
Rank 1
answered on 27 Nov 2012, 07:25 PM
Ivan,

Thank you for your example. I was able to make that one to work on my devices. I will go and compare your code to mine and try to spot difference.

One more issue/request. Is there a way to specify childbrowser widht and height? I need to have my status bar and top menu shown. Is it possible?
0
Ivan Ivanov
Telerik team
answered on 29 Nov 2012, 12:53 PM
Hi,

ChildBrowser plugin currently doesn't support resizing. You could take a look at the following link for more detailed information about  supported functionality in the plugin: https://github.com/alunny/ChildBrowser.

All the best,
Ivan Ivanov
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
0
FitFan (Legacy Drophit Account)
Top achievements
Rank 1
answered on 05 Mar 2013, 10:11 PM
After hours of working on this, it appears that in the event you are using the phone as a test device in a Non-Provisioned manner ie. the phone running ION, and the app running in ion either live updating from Graphite or three finger updating, i was only able to get this working when i made sure that this line:

var app = new kendo.mobile.Application(document.body, { initial:"#view-Login", transition: "slide", layout: "mobile-tabstrip" });

Was ahead of:

// Wait for PhoneGap to load
document.addEventListener("deviceready", onDeviceReady, false);

Not sure why this is but after tons of trial and error this seemed to be the fix..

Z
Tags
General Discussion
Asked by
Larry
Top achievements
Rank 1
Answers by
Jan-Dirk
Top achievements
Rank 1
Larry
Top achievements
Rank 1
fan
Top achievements
Rank 1
Ivan Ivanov
Telerik team
FitFan (Legacy Drophit Account)
Top achievements
Rank 1
Share this question
or