I use loadHTMLString method to load a HTML string.
self.webview.loadHTMLString("the html", baseURL:nil)
the html's content like below:
<!DOCTYPE html>
<html>
<head>
<script src="http://cdn.bootcss.com/jquery/2.1.4/jquery.js">
</script>
<script>
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
</script>
</head>
<body>
<p> Tap me to hide</p>
</body>
</html>
The result didn't work well. The javascript code didn't execute. But when I change <script src="http://cdn.bootcss.com/jquery/2.1.4/jquery.js">
to a local one and give a proper baseURL, it will work well.
httpURL to fetch your remote JavaScript? By default, iOS 9 does not do remotehttp(has to behttps).https. But I test on an iOS 8.4 device, it requirehttpstoo.