Pass value from a json array to a variable

Asked

Viewed 63 times

0

I’m creating an app for Android and I’m trying to pass a array JSON an element called phoneNumber, and I am using this plugin below, which brings this element in array: Telephonenumberplugin but the code I’m modeling is as follows:

 <script type="javascript">document.addEventListener("deviceready",onDeviceReady,false);function onDeviceReady(){window.plugins.sim.getSimInfo(successCallback, errorCallback);}function successCallback(result) {document.getElementById("tesouro").innerHTML=JSON.stringify(result);}function errorCallback(error) {document.getElementById("tesouro").innerHTML=JSON.stringify(result);}</script><a onclick="ph()">clique</a><p id="nada"></p>
  • It was unclear to me what you need and what you tried to do @Jonathansilva. Could you give some example?

  • Yes, the plugin I am using offers the feature of transforming the SIM information into a JSON, one of the elements is phoneNumber. through an onclick event, I would like to bring the value of phoneNumber as a result. but I’m not able to bring that value.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.