Start a new topic

How can i use callJavaScript?????????

How can i use callJavaScript?????????
1 Comment


Good afternoon,

 

First of all, your solution to AR is the best that i have found!!! But i need a little help from you guys.

 

I searched all the web for an answer for my question, and yet not found a good and complete answer!!!

 

I gave the idea to use your plugin in an aplication that i am constructing and my boss is thinking to buy the SDK PRO to android, BUT, first of all i need to prove that this works, and i need implement an aplication to pass dynamically data from the phonegap html to architectView.

 


I am tried to use this codes in the html phonegap to call the architectView:

1° attempt:

<script>

   $(document).ready(function() {

      $("#loadRa").on("click",function(){

         // load the AR world

         WikitudePlugin.isDeviceSupported(function() {

            WikitudePlugin.callJavaScript("newData()").loadARchitectWorld("assets/www/theWorld.html");

         });

      });

   });

</script>

 

But in the console is outputing this error message:

I/Web Console(22483): processMessage failed: Error: TypeError: Cannot call method 'loadARchitectWorld' of undefined:1035 

 

 


2° attempt

<script>

   $(document).ready(function() {

      $("#loadRa").on("click",function(){

         // load the AR world

         WikitudePlugin.isDeviceSupported(function() {

            WikitudePlugin.callJavaScript("newData()").loadARchitectWorld("assets/www/theWorld.html");

         });

      });

   });

</script>

 


But in the console is outputing this error message:

I/Web Console(22483): processMessage failed: Error: TypeError: Cannot call method 'callJavaScript' of undefined:1035 

 

3° attempt



<script>

   $(document).ready(function() {

      $("#loadRa").on("click",function(){

         // load the AR world

         WikitudePlugin.isDeviceSupported(function() {

            WikitudePlugin.callJavaScript("newData()");

            WikitudePlugin.loadARchitectWorld("assets/www/theWorld.html");

         });

      });

   });

</script>

 

On the html page that will be called, "theWorld.html", i create the "newData" function:


<script type="application/javascript" language="javascript">

   function newData(){

      alert('Function called!');

   }

</script>

 



But in the console is outputing this error message:

I/Web Console(22483): processMessage failed: Error: TypeError: Cannot call method 'callJavaScript' of undefined:1035 

 


I found on the web the solution of callJavaScript, BUT, this solution is not working on my aplication and the solutions of the web are not complete.

 

Please help me!!!!!!!!!!!!!!!

 

Thanks.


Login or Signup to post a comment