0

I'm making a call

webView.loadUrl("javascript:alert(javascriptFunc()));
webView.setUpWebChromeClient( new WebChromeClient() {


@Override
public boolan onJsAlert(WebView view, String url, final String message, JsResult result) {
....
}});

The message im getting is coming back as

[object Object];

It's supposed to be a JSON object thats the response however I can only get the String representation of the object. Please help on how I would access the object!

temp
  • 639
  • 1
  • 8
  • 22

1 Answers1

1

It's probably a json object but you are viewing it as a String. So you will need to translate the object to a String representation using JSON.stringify if you want to view it:

javascript:alert(JSON.stringify(javascriptFunc()));

Instead of

javascript:alert(javascriptFunc());
blue
  • 539
  • 3
  • 7