android/phonegap Uncaught ReferenceError

User Generated

wbaarlzraqbmn

Programming

Description

]I am getting the below exception when i try to invoke a javascript call from an android application that uses PhoneGap.

Stacktrack error:

here is my .jp file

[CODE]

        <!-- register -->

     

    function register(toggle){

    var e = toggle;

    var value = e.options[e.selectedIndex].value;

    console.info(toggle);

    console.info(value);

    if (value == "on"){

    window.WRAPPER.register();

    }else if(value == "off"){

    window.WRAPPER.deregister();

    }

   

    }

     

     

      <!-- send  -->

     

    function send(message){

    console.info('sending message');

    console.info(message);

    window.WRAPPER.send(message);

    }

     

   

    <!-- recieve -->

     

    function recieve(msg){

    console.info('recieving message');

    console.info(msg);

    document.getElementById("textarea1").innerHTML = messages;

    }[/CODE]

   

Here is my android code that creates a javascript:functionName() string and loads it to the webView

[CODE]    String text = "hello";

    String javaScript = "javascript:recieve(\'"+text+"\')";

    Log.d("TAG", javaScript);

    loadUrl(javaScript);[/CODE]


User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Thank you for the opportunity to help you with your question!

In most cases, the discipline is self-governed by the entities which require the programming, and sometimes very strict environments are defined

Please let me know if you need any clarification. I'm always happy to answer your questions.

Related Tags