0

I have a java script function in my html page which I've opened in an Inapp Browser in my ionic app. I want to execute this custom java script funtion using executeScript().

So far I have tried following but no luck. Is there any other way to do so?

browser.on("savePressed").subscribe(val => {

    //SAVE_FORM() is java script function inside html page

    browser.executeScript({code: "SAVE_FORM()"}).then(res => {
        console.log(res);
    }).catch(error => {
        console.log(error);
    });

    browser.close();
});

I'm using Themeable browser (https://ionicframework.com/docs/native/themeable-browser/) in which I have a button. When I press save button savePressed function is executed. In that function I want to run executeScript function which is supposed to run SAVE_FORM() function which is present inside source code of html document which is opened in inApp Browser.

casper123
  • 1,736
  • 4
  • 21
  • 39

0 Answers0