Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70440

Get multiple variables from 'executeScript' method of Cordova inAppBrowser

$
0
0

@Hamidaraghi wrote:

How can I get multiple values from Cordova InAppBrowser using executescript() method in ionic3? I can get single value from InAppBrowser using:

var browserRef = this.inAppbrowser.create("my_url", "_blank");
browserRef.on('loadstop').subscribe(() => {
  var codePass = "document.getElementById('RefNum').value";
  browserRef.executeScript({ code: codePass }).then((values) => {
   alert(JSON.stringify(values[0]))}) // Array of values!
      })

My HTML document that I want to extract values from is shown below:

<html >
<head id="Head1" >
    <title>Sep CallBack Page</title>
</head>
<body>
<input id="RefNum" value=<?php echo $_POST['RefNum']; ?> />
<input id="State" value=<?php echo $_POST['State']; ?> />
</body>
</html>

How can I retrieve both of RefNum and State values from my HTML document URL using single injection?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70440

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>