如何将运行时值传递给html中的javascript函数 [英] How do pass runtime values to a javascript function in html
本文介绍了如何将运行时值传递给html中的javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var barChartData = {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [
{
fillColor: "rgba(220,220,220,0.5)",
strokeColor: "rgba(220,220,220,1)",
data: [65, 59, 90, 81, 56, 55, 40]
}]
}
i需要将值传递给标签和数据....
i need to pass values to labels and data....
推荐答案
试试这种类型的
java脚本代码
try this type of
java Script code
document.getElementById("bar").innerHTML = barChartData;
和HTML代码这里
and HTML code here
<p id="bar" style="color:#770F0F;"></p>
当您的页面加载显示时
HTML页面上的数据。
点击回复任何查询或信息。
when your page load display the data on HTML page.
hit to reply any query or information.
您可以参考这个以获得更多参考。
http://www.htmlgoodies.com/beyond / Java类cript / javascript-tutorial-functions-and-classes.html [ ^ ]
You can refer this for more reference.
http://www.htmlgoodies.com/beyond/javascript/javascript-tutorial-functions-and-classes.html[^]
这篇关于如何将运行时值传递给html中的javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文