cordova - ThemeableBrowser within ThemeableBrowser -
i need open links within themeablebrowser link here.
i have following codes call themeablebrowser.
var options = { toolbar: { height: 44, color: '#cdcdcd' }, title: { color: '#003264ff', showpagetitle: true }, closebutton: { image: 'close', imagepressed: 'close_pressed', align: 'left', event: 'closepressed' }, backbutton: { image: 'back', imagepressed: 'back_pressed', align: 'left', event: 'backpressed' }, forwardbutton: { image: 'forward', imagepressed: 'forward_pressed', align: 'left', event: 'forwardpressed' }, closebutton: { image: 'close', imagepressed: 'close_pressed', align: 'left', event: 'closepressed' }, menu: { image: 'menu', imagepressed: 'menu_pressed', title: 'select quick menu', cancel: 'cancel', align: 'right', items: [ { event: 'btn1pressed', label: 'button1' }, { event: 'btn2pressed', label: 'button2' } }; function openbrowser(url) { cordova.themeablebrowser.open(host+url, '_blank', options) .addeventlistener("btn1pressed", function(e) { //alert("btn1pressed"); cordova.themeablebrowser.open("http://www.google.com", "_blank", options); }) .addeventlistener("btn2pressed", function(e) { //alert("btn2pressed"); cordova.themeablebrowser.open("http://www.yahoo.com", "_blank", options); }); }
so, there items within menu tappable , on each items, registered. now, when item (example button1) pressed, works first time after not work.
how can resolve issue?
ok, able resolve issue.i needed call same method(openbrowser()) within function this:
function openbrowser(url) { cordova.themeablebrowser.open(host+url, '_blank', options) .addeventlistener("btn1pressed", function(e) { // call same openbrowser("somedynamicurl") here // can not call cordova.themeablebrowser.open(url, '', {}) here, don't know why openbrowser("new dynamic url"); }) }
Comments
Post a Comment