0

we can call javascript function in loadUrl as below.

myWebView.loadUrl("javascript:(function() { var x=3+4;alert(3);})()");

Is it possible to add jquery function in loadUrl i.e $.post in loadUrl method of Webview. if yes then help me.

Panup Pong
  • 1,789
  • 2
  • 21
  • 43
santosh gore
  • 327
  • 1
  • 19

1 Answers1

1

jQuery is javascript. So you can :

myWebView.loadUrl("javascript:$('.navbar').css('display', 'none');");

Also don't forget to enable javascript on the webview :

myWebView.getSettings().setJavaScriptEnabled(true);
Hugo Gresse
  • 16,027
  • 8
  • 76
  • 110