问题描述:

I use such function to load data to WebView after loading page. Console tells what value of innerHTML is update but on WebView change don't show. In browser console everything is fine.

<script language="javascript" type="text/javascript">

function init_order() {

var elems = document.getElementById("body-id").getElementsByClassName("order_data");

if(arguments.length == elems.length){

console.log("Number of arguments is correct.");

}

else{

console.log("Incorrect number of arguments.");

console.log("Class Tag: "+elems.length);

console.log("Arguments: "+arguments.length);

}

for(i = 0; i < elems.length ; ++i){

var tag = elems[i];

var tagValue = elems[i].innerHTML;

if(tagValue.search("%@") != -1){

var replacedStr = tagValue.replace("%@",arguments[i]);

elems[i].innerHTML = replacedStr;

//console.log(arguments[i]);

console.log("value: "+elems[i].innerHTML);

}

}

// window.location.reload()

}

</script>

相关阅读:
Top