可能重复:
How do I pass return values from a javascript function to android?
我在html页面中有以下脚本
.....
<script type="text/javascript">
function fnCheckScroll() {
var iScrollWidth = book.scrollWidth;
var iOffsetWidth = book.offsetWidth;
var iDifference = iScrollWidth - iOffsetWidth;
alert("Width: " + iOffsetWidth
+ "\nscrollWidth: " + iScrollWidth
+ "\nDifference: " + iDifference);
return iScrollWidth;
}
</script>
</head>
<body onLoad="fnCheckScroll()">
<div id="viewer">
<div id="book">
.....
我想在我的java代码中使用iScrollWidth我该怎么做? TIA?