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,871
  • 2
  • 22
  • 44
santosh gore
  • 319
  • 2
  • 21

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
  • 17,195
  • 9
  • 77
  • 119