1

我一直在尝试将输出包含在 html 小插图中(您可以在此处datatable()查看源代码)。问题是,在我构建和安装包之后,小插图没有显示图表,而是显示了我没有得到的这个 html 标记(就像这个例子一样)<!–html_preserve–&gt;

请注意,小插图使用plot的是datatable. 方法的源代码在这里

我究竟做错了什么?

谢谢!


JavaScript 不返回 CSS 设置字体大小

如果通过 css 设置对象.style.fontSize 返回空。但是,如果直接在 html 中的对象上使用样式属性进行设置,则可以使用。

当它通过 CSS 设置时,是否有一些技巧可以使它工作?

例如:

<!DOCTYPE html>
<html lang="en-us">
	<head>
		<style>
			#Set_With_CSS_Style_Sheet
			{
				font-size:14pt;
			}
		</style>
	</head>

	<body onload=loaded()>

<!-- Both of these correctly sets the font size -->
<!-- JavaScript retrieves the font size when set in this manner (via style attribute). -->
		<div id="Set_With_Style_Attribute" style="font-size:10pt">CSS Font Size Test:10pt</div>

<!-- JavaScript returns empty when set in this manner (via css style sheet). -->
		<div id="Set_With_CSS_Style_Sheet">CSS Font Size Test: 14pt</div>

		<script type="text/javascript">
function loaded() {
	alert("Set With Style Attribute: " + this.document.getElementById("Set_With_Style_Attribute").style.fontSize);
	alert("Set With Style Sheet: "     + this.document.getElementById("Set_With_CSS_Style_Sheet").style.fontSize);
}
		</script>

	</body>
</html>

4

0 回答 0